Top Banner
Validating data integrity with blockchain By Rosco Kalis & Adam Belloum
22

Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Jun 06, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Validating data integrity with blockchain

By Rosco Kalis & Adam Belloum

Page 2: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Contents

• Method overview• Proof of concept audit trail• Further use case: data provenance• Limitations & Improvements

Page 3: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Method overview

Page 4: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Goal

• Validate the integrity of data• Detect malicious data tampering

Page 5: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Smart contracts

• Code on the blockchain• Data storage with persistent state

Page 6: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Smart contract storage

• Transaction Limits & Costs• Max ~11kB stored• €0.7 – €8.4 / kB stored

• Data confidentiality• Data encryption• Data hashing

Page 7: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Method

• Generate deterministic data identifier• Generate data hash• Store using a mapping in a smart contract

data

identifier

hash

Smart contract

mapping(bytes32 => bytes32)

Page 8: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Proof of Concept

Page 9: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Audit trail

• Logging all application interactions• A means to validate data integrity

• But: Regular audittrails can still betampered with• This is where our

method comes in

Page 10: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

• Framework for Rapid Domain Driven Development• UI generated from domain model

Page 11: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

AuditerService

• Called once for every change• Limit number of blockchain

transactions• Aggregate changes by

transactionId + sequence• ThreadLocal AuditEntry• PublisherService

Page 12: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Smart contract code

pragma solidity 0.4.23;contract AuditTrail {

...bytes28[] public auditedTransactions;mapping(bytes28 => bytes32) public dataHashes;...function audit(bytes28 transactionIdentifier, bytes32 dataHash) external ownerOnly {

require(dataHashes[transactionIdentifier] == 0, "A transaction can only be audited once");dataHashes[transactionIdentifier] = dataHash;auditedTransactions.push(transactionIdentifier);

}

function validate(bytes28 transactionIdentifier, bytes32 dataHash) external view returns(uint8) {return dataHashes[transactionIdentifier] == dataHash ? 0 : 1;

}}

• Mapping• Identifier to hash

• List of identifiers

• Audit method

• Validate method

Page 13: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Blockchain integration

• Web3j• Ethereum JSON-RPC• Smart contract wrappers

• Asynchronous transactions

Page 14: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Audit trail validation• Single Audit Entries• Smart contract validate-method

• Full audit trail• Validating individual Audit Entries• Iterating list of transaction

identifiers

Page 15: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Proof of Concept demo

Page 16: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Further use case

Page 17: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Data provenance

• Scientific reproducibility• Full research environment, input data, assumptions, etc.• Guarding against fraudulent research

Page 18: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Validating data provenance integrity

• Publish provenance data at the same time as research• Derive identifier from research title / DOI• Submit identifier + data provenance hash• Correct data provenance can always be verified

Page 19: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Limitations and Improvements

Page 20: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Limitations in the proof of concept

• Crashes / outages during the audit process• Transaction ordering and failing transactions• Malicious additions to the audit trail

Page 21: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Improvements to the method

• Permissions on smart contract• Storing metadata in the contract• Full data storage on IPFS or on-chain

Page 22: Validating data integrity with blockchain · Method overview. Goal •Validate the integrity of data •Detect malicious data tampering. Smart contracts •Code on the blockchain

Questions