Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Weaving the ILP Fabric into Bigchain DB


Published on

Dimitri De Jonghe presents on how Bigchain DB can use Interledger to connect disparate systems. Presented at the Interleder Workshop in London on 7/6/2016. Full presentation here:

Published in: Technology
  • Login to see the comments

Weaving the ILP Fabric into Bigchain DB

  1. 1. Weaving the ILP fabric into BigchainDB Dimitri De Jonghe
  2. 2. BigchainDB 101 Assets & Crypto-Conditions BigchainDB Ledger Plugin
  3. 3. Throughput >1,000,000 writes/s ~100,000 transactions/s Latency <100 ms Capacity Petabytes with each node adding 48TB Query Database is fully queryable Scalability Performance increases as nodes are added Decentralization Federated non-anonymous participation
  4. 4. Blockchain-ify big data Retain big-data performance Ordering of events by PAXOS-like solver Natural ordered log of transactions Add blockchain characteristics Decentralization Federated voting on transactions Group into blocks for speed Immutability Hash on prev. blocks Append only! Assets Digital signatures and other trapdoor functions
  5. 5. RethinkDB Cluster Architecture BigchainDB Federation Alice Bob Blockchain consensus Byzantine actors -> quorum _________________ Big data consensus RAFT -> strong consistency _________________
  6. 6. Decentralization of the Cloud Proc’ing FS Dec. DB/Ledger Partly Dec. Apps Proc’ing FS DB Apps Dec. Proc’ing Dec. FS Dec. DB/Ledger Dec. Apps Centralized Partly Decentralized Fully Decentralized
  7. 7. BigchainDB 101 Assets & Crypto-Conditions BigchainDB Ledger Plugin
  8. 8. Transaction chain Append only
  9. 9. Assets ____ Currency ____ (In-)tangible assets ____ Digital content/licenses ____ Supply chain
  10. 10. Assets with crypto-conditions Turing completeness private-publickey multi-signatures crypto-conditions smart-contracts
  11. 11. { "id":"933cd83a419d2735822a2154c84176a2f419cbd449a74b94e592ab807af23861", "transaction":{ "conditions":[{ "cid":0, "condition":{ "details":{ "bitmask":32, "public_key":"BwuhqQX8FPsmqYiRV2CSZYWWsSWgSSQQFHjqxKEuqkPs", "signature":None, "type":"fulfillment", "type_id":4 }, "uri":"cc:4:20:oqXTWvR3afHHX8OaOO84kZxS6nH4GEBXD4Vw8Mc5iBo:96" }, "new_owners":["BwuhqQX8FPsmqYiRV2CSZYWWsSWgSSQQFHjqxKEuqkPs"] }], "data":{ "hash":"872fa6e6f46246cd44afdb2ee9cfae0e72885fb0910e2bcf9a5a2a4eadb417b8", "payload":{"msg":"Hello BigchainDB!"} }, "fulfillments":[{ "current_owners":["3LQ5dTiddXymDhNzETB1rEkp4mA7fEV1Qeiu5ghHiJm9"], "fid":0, "fulfillment":"cf:4:Iq-BcczwraM2UpF-TDPdwK8fQ6IXkD_6uJaxBZd984yx…", "input":None }], "operation":"CREATE", "timestamp":"1460981667.449279" }, "version":1 } Assets with crypto-conditions condition = cc.Ed25519Fulfillment() condition.public_key = “BwuhqQ...” # optionally provide condition structure condition.to_dict() condition.condition_uri fulfillment = input.conditions[0].from_dict() fulfillment.sign(message, private_key) fulfillment.serialize_uri()
  12. 12. { "id":"933cd83a419d2735822a2154c84176a2f419cbd449a74b94e592ab807af23861", "transaction":{ "conditions":[{ "cid":0, "condition":{ "details":{ "bitmask":32, "public_key":"BwuhqQX8FPsmqYiRV2CSZYWWsSWgSSQQFHjqxKEuqkPs", "signature":None, "type":"fulfillment", "type_id":4 }, "uri":"cc:4:20:oqXTWvR3afHHX8OaOO84kZxS6nH4GEBXD4Vw8Mc5iBo:96" }, "new_owners":["BwuhqQX8FPsmqYiRV2CSZYWWsSWgSSQQFHjqxKEuqkPs"] }], "data":{ "hash":"872fa6e6f46246cd44afdb2ee9cfae0e72885fb0910e2bcf9a5a2a4eadb417b8", "payload":{"msg":"Hello BigchainDB!"} }, "fulfillments":[{ "current_owners":["3LQ5dTiddXymDhNzETB1rEkp4mA7fEV1Qeiu5ghHiJm9"], "fid":0, "fulfillment":"cf:4:Iq-BcczwraM2UpF-TDPdwK8fQ6IXkD_6uJaxBZd984yx…", "input":None }], "operation":"CREATE", "timestamp":"1460981667.449279" }, "version":1 } Transaction malleability fulfillment = input.conditions[0].from_dict() fulfillment.sign(message, private_key) fulfillment.serialize_uri()
  13. 13. Tracking the story of 3 assets
  14. 14. Other crypto-conditions BigchainDB supports crypto-conditions natively: ● Hashlocks: Preimage-SHA-256 ● Signatures: Ed25519 ● Threshold: complex branches possible Python version for crypto-conditions @ >pip install cryptoconditions
  15. 15. “Experimental” crypto-conditions BigchainDB append only, how to provide escrow? if timeout_condition.validate(utcnow()): execute_fulfillment.validate(msg) == True abort_fulfillment.validate(msg) == False else: execute_fulfillment.validate(msg) == False abort_fulfillment.validate(msg) == True
  16. 16. “Experimental” crypto-conditions Timeout-condition now() < expiry_time Inverter if fact == True: output = False
  17. 17. Utils for crypto-conditions JSON/dict serialization: to_dict(), from_dict() Queryability of complex branches: get/update/insert/remove subconditions get_subcondition_path_for_type(type_id): … return subcondition, indices fulfillment.subconditions[indices[0]]['body'] .subconditions[indices[1]]['body'] .subconditions[indices[2]]['body']
  18. 18. BigchainDB 101 Assets & Crypto-Conditions BigchainDB Ledger Plugin
  19. 19. BigchainDB web stack API websocket ilp-plugin-bigchaindb / <your_app>
  20. 20. BigchainDB Ledger Plugin connect()/disconnect() Connect to a BigchainDB API + websocket getBalance() Retrieve the number of assets for an account send(transfer) Local ledger escrow fulfillCondition(transfer, conditionFulfillment) Fulfill the execute branch of the escrow getConnectors(): <example-specific> Get accounts with multi-ledger connections
  21. 21. Demo!
  22. 22. Hackaton Proposals • Challenge: Payment system + Fungible Assets • Idea: Pay as you stream platform – 1 StreamCoin = Y dollars – 1 StreamCoin = X time units of streaming
  23. 23. When Alice wants to listen to music... Alice $0.5 Escrow 0 StreamCoin 0 StreamCoin 1 Escrow 0 PAYS 0 © Interledger Community