1. Linked Data Indexing
of Distributed Ledgers
Allan Third and John Domingue (@johndmk)
Knowledge Media Institute
The Open University, UK http://blockchain.open.ac.uk/
2. Agenda
• Motivation
• Ethereum Model
• Ontologies
• Architecture
• RDF examples
• Smart Contracts
• Challenges, Future Work and Summary
4. Blockchain is a Linked List
A blockchain actually contains
two different hash structures.
The first is a hash chain of
blocks that links the different
blocks to one another.
The second is internal to each
block and is a Merkle Tree of
transactions within the
blocks.
This allows for efficiently
verifiable proofs that a
transaction was included in a
block.
5. Contracts in Ethereum
Maintain a data store
representing
something which is
useful to either other
contracts or to the
outside world
Serve as a sort of
externally owned
account with a more
complicated access
policy
Manage an ongoing
contract or
relationship between
multiple users
Provide functions to
other contracts;
essentially serving as
a software library.
Contracts in Ethereum generally serve 4 purposes:
source: Richard Gendal Brown “A Simple Model for Smart Contracts”
http://gendal.me/2015/02/10/a-simple-model-for-smart-contracts/
7. Reputation Contract
Functions:
Storage:
sendReputation
getPersonBalance()
getReputationAttribute
attribs[address = > Attrib]
Attrib { uint balanceOf;
mapping(string => uint);
string[] attribStrings
}
Reputation
Attribute
token
Balances
Reputation Smart Contract
Tokens left
to assign
My Reputation
Peer Reputation Page
Kevin’s Reputation View
Communication: 14
Collaboration: 06
Organisation: 12
Ethics: 05
Problem Solving: 10
Engagement: 04
your Ethereum address
password to private key
Signing this transaction will transfer stated
Reputation Tokens + ETH gas payment from
your account. Estimated gas cost is 0.02 ETH.
Maximum gas cost is set to 0.05 ETH
Transfer
Reputation Tokens Left: 57
number of tokens to transfer
Assign Reputation
My Reputation
Peer Reputation Page
Michelle’s Reputation View
Communication: 06
Collaboration: 02
Organisation: 10
Ethics: 12
Problem Solving: 08
Engagement: 16
your Ethereum address
password to private key
Signing this transaction will transfer stated
Reputation Tokens + ETH gas payment from
your account. Estimated gas cost is 0.02 ETH.
Maximum gas cost is set to 0.05 ETH
Transfer
Reputation Tokens Left: 68
number of tokens to transfer
Assign Reputation
Signed
TX
Reputation
Attribute
token
Balances
Tokens left
to assign
Michelle transfers 4 Reputation tokens for ‘Organisation’ to Kevin
17. How do we…
• …find Michelle’s transfers to everyone?
• ...summarise reputation transferred by groups of users?
• ...link data to semantically related external sources?
18. Linked Data indexing
• Problems
– Related data spread across blocks
– No high-level semantics for contracts
• Need
– An index onto blockchain
– To connect blockchain data to Linked Data
– To allow richer contract semantics
• LD index for blockchain
20. Flex Ledger 1.0
• A flexible format and protocol for
decentralized ledgers on the Web
• FL Web API to wrap blockchains
– Vocab. extractable from JSON-LD model
• No explicit semantics
https://w3c.github.io/flex-ledger/
21. EthOn - An Ethereum Ontology
http://ethon.consensys.net/EthOn_spec.html
36. Challenges & Future Work
• Addressing
– Linked Data needs URIs; how to get the “U”?
• Ethereum Name Service:
– “DNS for Ethereum” hosts .eth top-level domain
– But specific to Ethereum
• Currently use node URI – not distributed
37. Challenges & Future Work
• Distributed index
– Index on one node: centralised
• But good for app-specific customisation
• Could we have
– Data (e.g., RDF) stored on IPFS/Swarm?
– Queries executed within a smart contract?
– i.e., both data & querying distributed
• Performance & cost?
• Use cases?
38. Our private Ethereum network
• 6 nodes
– 5 mining
– 1 observation (running listener & RDF store)
• Chain created 28th of April 2016
• 1 465 104 blocks (3.5 Gb)
– As of 31/03/2017
• 22 million triples
39. Summary
• Blockchains
– Are a linked list based on hashes
– No inbuilt indexing mechanism
– Contain ‘smart contracts’
• Basic semantic indexing based on BLONDiE
• Challenges
– Universal naming system
– Distributed vs centralised index
Notes de l'éditeur
Not really clear why EthOn was started in preference to BLONDiE’s own Ethereum vocabulary
The EthOn Ethereum ontology, described using W3C RDF Schema and the Web Ontology Language. It is closely aligned with Gavin Wood's Ethereum yellow paper.
Generated by during compilation for Ethereum. ABI needed because contract is compiled.