Bigchaindb 2.0 The Blockchain Database
Bigchaindb 2.0 The Blockchain Database
0
The Blockchain Database
BigchainDB GmbH, Berlin, Germany
May 2018
Paper version 1.0
Abstract
BigchainDB is software that has blockchain properties (e.g. decentral-
ization, immutability, owner-controlled assets) and database properties
(e.g. high transaction rate, low latency, indexing & querying of structured
data). It was first released—open source—in February 2016 and has been
improved continuously ever since. BigchainDB version 2.0 makes signifi-
cant improvements over previous versions. In particular, it is now Byzan-
tine fault tolerant (BFT), so up to a third of the nodes can fail in any way,
and the system will continue to agree on how to proceed. BigchainDB 2.0
is also production-ready for many use cases. In this paper, we review the
design goals of BigchainDB 2.0 and how they were achieved, we explore
some use cases, we show how BigchainDB fits into the overall decentral-
ization ecosystem, we follow the life of a transaction to understand how
BigchainDB 2.0 works, we note ways to try BigchainDB, we outline how
you can contribute, and we summarize future plans.
1
BigchainDB 2.0 was designed to resolve all those issues while retaining the
desirable database and blockchain properties. Below, we go through each design
goal of BigchainDB 2.0 and outline how it was achieved.
Typical Distributed
Typical Blockchain BigchainDB
Database
Decentralization X X
Byzantine Fault
X X
Tolerance
Immutability X X
Owner-Controlled
X X
Assets
High Transaction
X X
Rate
Low Latency X X
Indexing
& Querying of X X
Structured Data
1.2 Immutability
Once data gets stored in a BigchainDB network, it can’t be changed or erased,
or at least not without great difficulty. If some data somehow manages to get
changed or erased, then that is detectable. One might say that the storage
1 Technically, up to one third of the voting power can fail, but we usually run BigchainDB
networks with all nodes having the same voting power, so one third of voting power is the
same as one third of the nodes.
2
is “practically immutable” but in the blockchain world, one usually just says
“immutable.”
BigchainDB uses several strategies to achieve practical immutability. The
simplest one is that there are no BigchainDB-provided APIs to change or erase
stored data.
Another strategy is that every node has a full copy of all the data in a stand-
alone MongoDB database (i.e. there is no global MongoDB database). Even if
one node gets corrupted or destroyed, the other nodes won’t be affected and
will still have a copy of all the data.
Another strategy is that all transactions are cryptographically signed. After
a transaction is stored, changing its contents will change the signature, which
can be detected (unless the public key is also changed, but that should also be
detectable because every block of transactions is signed by the a node, and the
public keys of all the nodes are all known).
could have a condition which says that “Jamie OR (Pat AND Kelly) OR (three of {Casey,
Drew, Laurie, Riley or Whitney})” must sign.
3
since BigchainDB 2.0 is based on Tendermint, we can look at other Tendermint-
based networks to get a sense of what can be expected. According to the Cosmos
whitepaper [8]:
2 Use Cases
BigchainDB, with the capabilities mentioned in the previous section, can serve a
multitude of use cases. Wherever there is a need of immutable, tamper-resistant
data representing digital assets, BigchainDB can be used. There are several
industry verticals which can directly benefit from BigchainDB features. In the
4
following sub-sections, we will briefly touch some of these industry verticals and
discuss how BigchainDB can be of help in these scenarios.
2.4 Identity
Identity is one of the most critical pieces when it comes to managing user-specific
information. It has become ever more important in scenarios like IoT and Digital
Twins where even machines have an identity. With identity theft becoming one
5
of the major concerns of today, we need to make sure that identity of a human
or a machine is self-sovereign and hack-proof. Because of a large amount of
data associated with identities, we also need to make sure that the systems
handling identity-related data are capable of handling high scale. That’s when
BigchainDB becomes a natural fit for solving identity-related use cases because
of its combined characteristics of blockchains and databases.
6
as well. Figure 1 illustrates some ways BigchainDB could be used in various
technology stacks.
Centralized Decentralized
Processing (e.g. EC2) Processing (e.g. EC2) Processing (e.g. Eth VM)
7
{
"id": "3667c0e5cbf1fd3398e375dc24f47206cc52d53d771ac68ce14d c
,→ df0fde806a1c",
"version": "2.0",
"inputs": [
{
"fulfillment": "pGSAIEGwaKW1LibaZXx7_NZ5-V0alDLvrguGLyL c
,→ RkgmKWG73gUBJ2Wpnab0Y-4i-kSGFa_VxxYCcctpT8D6s4uTGOO c
,→ F-hVR2VbbxS35NiDrwUJXYCHSH2IALYUoUZ6529Qbe2g4G",
"fulfills": null,
"owners_before": [
"5RRWzmZBKPM84o63dppAttCpXG3wqYqL5niwNS1XBFyY"
]
}
],
"outputs": [
{
"amount": "1",
"condition": {
"details": {
"public_key":
,→ "5RRWzmZBKPM84o63dppAttCpXG3wqYqL5niwNS1XBFyY",
"type": "ed25519-sha-256"
},
"uri": "ni:///sha-256;d-_huQ-eG-QQD-GAJpvrSsy7lLJqyNh c
,→ tUAs_own7aTY?fpt=ed25519-sha-256&cost=131072"
},
"public_keys": [
"5RRWzmZBKPM84o63dppAttCpXG3wqYqL5niwNS1XBFyY"
]
}
],
"operation": "CREATE",
"asset": {
"data": {
"message": "Greetings from Berlin!"
}
},
"metadata": null
}
8
4.2 Sending a Transaction to a BigchainDB Network
Once one has a transaction, they can send it to a BigchainDB network using
the BigchainDB HTTP API [19]. More specifically, one would use one of the
following endpoints, with the transaction in the body of the HTTP request:
POST /api/v1/transactions
POST /api/v1/transactions?mode=async
POST /api/v1/transactions?mode=sync
POST /api/v1/transactions?mode=commit
Later, we’ll see what the different modes mean. A BigchainDB driver could
also be used to post a transaction. The HTTP request (containing the trans-
action) can be sent to any of the nodes in the BigchainDB network, or even
more than one. Figure 2 illustrates the main components in a four-node Big-
chainDB 2.0 network, and how they communicate with each other.
1
2
e
e
od
od
N
BigchainDB Node
mongoDB
BigchainDB Server
3
4
e
e
od
od
Tendermint
N
9
then that’s the end of the story for the transaction, the HTTP response status
code is 400 (Error), and the response body gives some information about what
was invalid. If the transaction is valid, then it’s converted to Base64 and put
into a new JSON string with some other information (such as the mode). Big-
chainDB then sends that string to the local Tendermint instance in the body of
an HTTP POST request. That request uses the Tendermint Broadcast API [21].
(Tendermint has other APIs.)
10
• Every Tendermint instance has a local mempool (memory pool) of trans-
actions which have passed initial validation, but haven’t been included in
a block yet.
• InitChain
• Info
• CheckTx
• BeginBlock
• DeliverTx
• EndBlock
• Commit
11
• Tendermint ABCI Specification [25]
• Papers about Tendermint found by Google Scholar [26]
12
as Ethereum. Longer-term, we want to make it possible to create a public
BigchainDB network where anyone can add a node without getting permission.
9 Conclusion
BigchainDB is a blockchain database: it has both blockchain properties and
database properties. That combination makes it useful for a wide variety of
use cases, including supply chain, IP rights management, digital twins & IoT,
identity, data governance and immutable audit trails. BigchainDB 2.0 includes
significant improvements, including the integration of Tendermint for inter-node
networking and Byzantine fault tolerant (BFT) consensus. BigchainDB 2.0
is now production-ready for many uses cases. For more information, see the
BigchainDB website at bigchaindb.com.
References
[1] Carlo Thomas. ascribe announces scalable blockchain database Big-
chainDB. CoinReport, February 2016. https://coinreport.net/
ascribe-announces-scalable-blockchain-database-bigchaindb/.
[2] Leslie Lamport, Robert Shostak, and Marshall Pease. The Byzantine Gen-
erals Problem. ACM Transactions on Programming Languages and Systems
(TOPLAS), 4(3):382–401, July 1982. http://research.microsoft.com/
en-us/um/people/lamport/pubs/byz.pdf.
[3] Jae Kwon. Tendermint: Consensus without Mining, fall 2014.
[11] J. Benet. IPFS – Content Addressed, Versioned, P2P File System. http:
//static.benet.ai/t/ipfs.pdf, 2014.
[12] Ocean Protocol: A Decentralized Substrate for AI Data & Services. https:
//oceanprotocol.com/tech-whitepaper.pdf.
13
[13] Ethereum. https://ethereum.org/.
[14] Vitalik Buterin. Ethereum White Paper: A Next Genera-
tion Smart Contract & Decentralized Application Platform.
http://blog.lavoiedubitcoin.info/public/Bibliotheque/
EthereumWhitePaper.pdf.
[15] Hyperledger Fabric. https://www.hyperledger.org/projects/fabric.
[16] Jason Teutsch and Christian Reitwießner. A scalable verification solution
for blockchains. November 2017.
[17] BEP-13: BigchainDB Transactions Spec v2. https://github.com/
bigchaindb/BEPs/tree/master/13.
[18] BigchainDB Drivers & Tools. https://docs.bigchaindb.com/projects/
server/en/latest/drivers-clients/index.html.
[19] BigchainDB HTTP API. https://docs.bigchaindb.com/projects/
server/en/latest/http-client-server-api.html.
[20] PEP 3333 – Python Web Server Gateway Interface v1.0.1. https://www.
python.org/dev/peps/pep-3333/.
[21] Tendermint Broadcast API. http://tendermint.readthedocs.io/
projects/tools/en/master/using-tendermint.html#broadcast-api.
[22] Tendermint ABCI Specification. https://github.com/tendermint/
abci/blob/master/specification.rst.
[23] BigchainDB Enhancement Proposals. https://github.com/bigchaindb/
BEPs.
[24] Tendermint Documentation. http://tendermint.readthedocs.io/
projects/tools/en/master/index.html.
[25] ABCI Overview. http://tendermint.readthedocs.io/projects/
tools/en/master/introduction.html#abci-overview.
[26] Papers about Tendermint found by Google Scholar. https://scholar.
google.de/scholar?hl=en&as_sdt=0%2C5&q=Tendermint&btnG=.
[27] BigchainDB – Get Started. https://www.bigchaindb.com/developers/
getstarted/.
[28] BigchainDB chat rooms. https://gitter.im/bigchaindb/home.
[29] BEP-1: The BigchainDB Variant of the Collective Code Construction Con-
tract (C4). https://github.com/bigchaindb/BEPs/tree/master/1.
[30] The bigchaindb/BEPs Repository on Github. https://github.com/
bigchaindb/BEPs.
[31] BEP-2: The BigchainDB Variant of the Consensus-Oriented Specification
System. https://github.com/bigchaindb/BEPs/tree/master/2.
[32] BigchainDB Roadmap. https://github.com/bigchaindb/org/blob/
master/ROADMAP.md.
14