SlideShare a Scribd company logo
Blockchain & Security in Oracle by Emmanuel Abiodun
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Blockchain & Security
Emmanuel Abiodun
Blockchain Architect
Oracle Cloud
October 2018
emmanuel.abiodun@oracle.com
www.linkedin.com/in/emmanuel-abiodun/
Nov 2018
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, timing, and pricing of any
features or functionality described for Oracle’s products may change and remains at the
sole discretion of Oracle Corporation.
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Introduction to Oracle Blockchain Cloud Service
State Database Enhancements
Smart Contract Design Best Practices
Some Security Considerations
Q&A
1
2
3
4
5
Confidential – Oracle Internal/Restricted/Highly Restricted 4
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Pre-Assembled
Enterprise-Grade
Managed
Plug and Play Integrations
Open
Oracle Blockchain Cloud Service
5
ORACLE
BLOCKCHAIN
CLOUD SERVICE
Oracle’s
Experience and
Expertise
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Blockchain Cloud Platform
6
Container
services
Identity
Management
Services
Events Management
Services
Data
Services
ORACLE CLOUD INFRASTRUCTURE and PAAS SERVICES
ON PREMISES APPS
CONSENSUS
Validates transactions before adding to chain
SMART CONTRACTS
Business logic based on agreements
DISTRIBUTED LEDGER
Whole state data and its history
CONFIDENTIALITY
Permissioned blockchain with private channels
REST API / SDKs for Go, Java, and Javascript
ORACLE BLOCKCHAIN PLATFORM
Hyperledger
Fabric Peers
in Customer
Datacenters or
3rd Party Clouds
External
Members
SCMERP HCM CX
ORACLE SAAS
CRM
OPEN SOURCE HYPERLEDGER FABRIC
3rd Party
SaaS
Custom
Cloud Apps
*
Managed PaaS
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Built on Hyperledger Fabric
• Clients submit transactions for endorsement to peers
• Peers call smart contracts aka chaincode to simulate/endorse transactions
• Client submits endorsed transaction to ordering service
• Peers validate and commit transactions
– Verify policies met and versions for multi-version concurrency control (MVCC)
• World state database is a key/value store
– Get by key, key range, or partial composite key
– Optional databases provide rich queries that can query based upon values
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Hyperledger Fabric Transaction Flow
Client Application
Fabric SDK
Keys
Membership Service
Peers
Endorser
Simulates TX
World
State
Committer
Applies changes
Ordering Service
Certificate
Authority
4.0 - Deliver TX Batch
Validate Signatures
and Authorization
Orders TXs into
batches
according to
consensus3.0 - Submit Endorsed TX
Includes RWset and endorser
signatures
Ledger
5.0 – Writes ledger block
5.1 - Updates State
Oracle Confidential – Under NDA
6.0 – Commit Notification
Smart Contract
(Chaincode)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle State Database Enhancements
• Default state database in Hyperledger Fabric is LevelDB
• Optional database supporting rich queries CouchDB – extremely slow
• Neither supports isolation, snapshots, or local transactions
• Fabric read locks the database for read access during endorsement
• Fabric write locks the database for exclusive access during commitment
• Result: Endorsement and commitment cannot overlap
Hyperledger Fabric
Confidential – Oracle Internal/Restricted/Highly Restricted 9
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 10
State Based Enhancements
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle State Database Enhancements
• OBCS uses Berkeley Database (BDB) for state database which supports local
transactions and isolation
• SQL layer on top of BDB for rich queries
• Replace database locking with a transaction manager using local txn
• Allows endorsement and commitment to execute in parallel
• Supports SQL SELECT statements and CouchDB queries in rich queries
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12
Smart Contract Design Best
Practices
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
OABCS Application Design Best Practices
• Start small
• Keep it simple
• Not everything belongs on a ledger
• Workflow is best done in the application, not smart contracts
• L10N I18N
• Pull instead of push
• Determine who you trust and how much you trust them
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Not Everything Belongs on the Ledger
• Blockchains replicate the ledger – potentially many copies
• For large objects, this dramatically increases storage requirements
• Store what’s absolutely needed and must be shared
• Large objects or PII should be stored off-chain if possible
– Store them elsewhere
– Place hash of object on the ledger as proof
– Mediate off-chain storage access via the blockchain
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Workflow in the Application, not Smart Contracts
• Ledger records the transactions
• Workflow such as multi-step processes best left to external tools
• Examples:
– Voting to add new member to blockchain network
• the state of the votes is maintained on blockchain
• Acting on the vote is a workflow issue
• Use events to move workflow forward
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Who Do You Trust and How Much Do You Trust Them?
• This determines many design decisions such as:
• Endorsement policies – who needs to validate transactions
• How confidential is the data?
– Peers running outside Oracle cloud can snoop data
– By default, any user can read ledger
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Agenda
Introduction to Blockchain and Smart Contracts
CargoSmart
OABCS Application Design Best Practices
Hyperledger Fabric Smart Contract best practices
Summary and Q&A
1
2
3
4
5
Confidential – Oracle Internal/Restricted/Highly Restricted 17
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Hyperledger Fabric Smart Contracts
• Smart contracts provide the cross organization business logic
• Similar to stored procedures
• Executed multiple times
• Only thing that update world state
• Written in Go, Node.js, and Java
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Smart Contract Mandatory Practice
• Deterministic!
– Do NOT generate guids, random numbers,…
– Do NOT try to the get the time
• If needed have client pass in:
– guids, random numbers, timestamps,…
– Data from external systems
• Watch for timeouts
Confidential – Oracle Internal/Restricted/Highly Restricted
Better than best practices
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Avoid Data Hot Spots or Global Keys
• Keys that are read and written frequently
– Sequence number
– Totals
• Likely cause invalidation errors
– Especially for larger block sizes
• Higher likelihood for MVCC errors
– Transactions have to be retried
Confidential – Oracle Internal/Restricted/Highly Restricted
Performance
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
World State Access
• Watch for phantom reads
– Standard Fabric rich queries don’t affect RWset
– OBCS rich queries are re-executed at validation time
• Create indexes for rich queries
• Using OBCS
– Use rich queries instead of composite keys
– Push summaries, calculations, etc., down to database
• Average number of marbles owned
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Avoid Off Chain Access
• Avoid network connections/interactions if possible!
– Potential source of non-determinism
• Off chain data
– Let client provide the data
– Store hash in ledger as proof
• Off chain applications
– Oracles are fine
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Push vs Pull
• Push – smart contract pushes data
– Smart contract updating an external application
– But will be called multiple times – once for each endorsement
• Pull – application pulls data
– External application calls smart contract to put data
– Can maintain queue in world state
– Use a chaincode event to trigger
– Receiving application pulls the data from the blockchain
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Circuit Breakers
• Emergency stop
• Essentially denies all executions until reset
• Commonly used to deal with serious bugs or security issues
• Controlled by limited parties, e.g. admins
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Side DB
Confidential – Oracle Internal/Restricted/Highly Restricted
Peer3
Chaincode State
hash(k1), hash(secret value)
Private State
k1, secret value
Channel 1
Peers in collection
Peer2
Peers not in collection
Gossip
Chaincode State
hash(k1), hash(secret value)
Private State
k1, secret value
Chaincode State
hash(k1), hash(secret value)
Peer1
Endorsing
Committing
Endorsing
Committing
Committing
only
Private state among subset of peers
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 26
Some Security Considerations
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Privacy and Confidentiality
• Only put what’s necessary on the ledger!
• All peers get a copy, consider where peers run
• Encrypt data or store sensitive data off chain
• Choose strong encryption – quantum computing is coming
• Use side database feature of Fabric
– Only specific peers get private data, hash of key/value recorded in ledger
• Soon: Anonymous Authentication and Zero-Knowledge Asset Transfer
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Privacy and Confidentiality
• Normally any authorized user has access to ledger
• Use Fabric fine grained access control
– Prohibit or limit access to query system chaincode and events
– Only allow access via invoking smart contracts
• Implement fine grained access control in chaincode
– Take control of who has access to what
– Maintain the access information in chaincode
– Field level access control, attribute access control
• Use transient data to pass in data to be excluded from the ledger
Confidential – Oracle Internal/Restricted/Highly Restricted
Keep prying eyes out
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Security
• Use static analysis tools
• Use SSL/TLS to protect communication
• Check everything!
– all needed arguments
– Injection attacks
– Verify identity
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Security
• Docker isolation is not enough
• Kata containers use in multi-tenancy
• Ensure customer can harm only himself
• Careful with platform / env secrets
Confidential – Oracle Internal/Restricted/Highly Restricted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 31
Questions?
Blockchain & Security in Oracle by Emmanuel Abiodun

More Related Content

PDF
Autonomous Data Warehouse
PDF
Oracle - Hyperledger Silicon Valley meetup, June 20, 2018
PDF
20190404 Blockchain GIG #2 Oracle Mark発表資料
PDF
Oracle goldegate microservice
PDF
Bringing Enterprise to the Blockchain - Moving from Science Experiment to Pra...
PPTX
Securing APIs with Open Policy Agent
PPTX
Oracle Autonomous Data Warehouse Cloud Webex - with Demo
PPTX
Oracle ADWC
Autonomous Data Warehouse
Oracle - Hyperledger Silicon Valley meetup, June 20, 2018
20190404 Blockchain GIG #2 Oracle Mark発表資料
Oracle goldegate microservice
Bringing Enterprise to the Blockchain - Moving from Science Experiment to Pra...
Securing APIs with Open Policy Agent
Oracle Autonomous Data Warehouse Cloud Webex - with Demo
Oracle ADWC

What's hot (20)

PDF
Oracle Cloud – Application Performance Monitoring
PPTX
DevDay: Node Analytics with Python, Chainhaus
 
PPTX
Fast Data Overview for Data Science Maryland Meetup
PDF
20191010 Blockchain GIG#5_oracle
PDF
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
PDF
Flash session -goldengate--lht1053-lon
PPTX
DevDay: Mike Hearn Keynote, R3
 
PDF
Oracle Data Protection - 1. část
PPTX
Klarna Tech Talk - Mind the Data!
PDF
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
PPTX
MongoDB World 2018: A Journey to the Cloud with Fraud Detection, Transactions...
PPTX
Balancing data democratization with comprehensive information governance: bui...
PDF
NZOUG-GroundBreakers-2018 - Troubleshooting and Diagnosing 18c RAC
PPTX
AMIS Oracle OpenWorld & CodeOne Review - Pillar 2 - Custom Application Develo...
PDF
2009.10.22 S308460 Cloud Data Services
PPTX
Building a data-driven authorization framework
PPTX
O2’s Financial Data Hub: going beyond IFRS compliance to support digital tran...
PDF
Apache Atlas. Data Governance for Hadoop. Strata London 2015
PDF
The future of Hadoop security and its evolution by Alejandro González at Big ...
PPTX
Percona Live Europe 2018: What's New in MySQL 8.0 Security
Oracle Cloud – Application Performance Monitoring
DevDay: Node Analytics with Python, Chainhaus
 
Fast Data Overview for Data Science Maryland Meetup
20191010 Blockchain GIG#5_oracle
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
Flash session -goldengate--lht1053-lon
DevDay: Mike Hearn Keynote, R3
 
Oracle Data Protection - 1. část
Klarna Tech Talk - Mind the Data!
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
MongoDB World 2018: A Journey to the Cloud with Fraud Detection, Transactions...
Balancing data democratization with comprehensive information governance: bui...
NZOUG-GroundBreakers-2018 - Troubleshooting and Diagnosing 18c RAC
AMIS Oracle OpenWorld & CodeOne Review - Pillar 2 - Custom Application Develo...
2009.10.22 S308460 Cloud Data Services
Building a data-driven authorization framework
O2’s Financial Data Hub: going beyond IFRS compliance to support digital tran...
Apache Atlas. Data Governance for Hadoop. Strata London 2015
The future of Hadoop security and its evolution by Alejandro González at Big ...
Percona Live Europe 2018: What's New in MySQL 8.0 Security
Ad

Similar to Blockchain & Security in Oracle by Emmanuel Abiodun (20)

PDF
Blockchain, Hyperledger and the Oracle Blockchain Platform
PDF
How to Build a Decentralized Blockchain App with the Oracle Blockchain Platform
PDF
Hyperledger Austin meetup July 10, 2018
PDF
blockchain workshop - hyperledger and oabcs - technical
PDF
Oracle Blockchain Experience Day
PDF
Blockchain in government and the public sector
PPTX
Oracle Blockchain Cloud Service
PPTX
Blockchain on the oracle cloud, the next big thing
PDF
Oracle Blockchain Platform
PDF
20190220 Oracle Blockchain Day公開資料
PDF
blockchain workshop - blockchain and oabcs - solutions
PDF
Oracle Blockchain Cloud Service
PPTX
Blockchain: a major disruptor in 3 industries
PDF
Ibm blockchain - Hyperledger 15.02.18
PPTX
A Decision Model for Choosing Patterns in Blockchain-based Applications
PDF
Wwc developing hyperledger applications v4
PDF
Blockchain-based Applications
PDF
An introduction to blockchain and hyperledger v ru
PPTX
Hyperledger fabric 20180528
PPTX
Security best practices for hyperledger fabric
Blockchain, Hyperledger and the Oracle Blockchain Platform
How to Build a Decentralized Blockchain App with the Oracle Blockchain Platform
Hyperledger Austin meetup July 10, 2018
blockchain workshop - hyperledger and oabcs - technical
Oracle Blockchain Experience Day
Blockchain in government and the public sector
Oracle Blockchain Cloud Service
Blockchain on the oracle cloud, the next big thing
Oracle Blockchain Platform
20190220 Oracle Blockchain Day公開資料
blockchain workshop - blockchain and oabcs - solutions
Oracle Blockchain Cloud Service
Blockchain: a major disruptor in 3 industries
Ibm blockchain - Hyperledger 15.02.18
A Decision Model for Choosing Patterns in Blockchain-based Applications
Wwc developing hyperledger applications v4
Blockchain-based Applications
An introduction to blockchain and hyperledger v ru
Hyperledger fabric 20180528
Security best practices for hyperledger fabric
Ad

More from Vishwas Manral (7)

PDF
Zero Trust Enterprise Network at Adobe
PDF
IDSA Overview at CSA SV
PDF
0chain Blockhain and off-chain storage integrity
PPTX
CSA Presentation - Software Defined Perimeter
PDF
CSA SV Threat detection and prediction
PDF
Docker security microservices
PDF
Microservices security CSA meetup ppt 10_21_2015_v2-2
Zero Trust Enterprise Network at Adobe
IDSA Overview at CSA SV
0chain Blockhain and off-chain storage integrity
CSA Presentation - Software Defined Perimeter
CSA SV Threat detection and prediction
Docker security microservices
Microservices security CSA meetup ppt 10_21_2015_v2-2

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
KodekX | Application Modernization Development
PDF
Machine learning based COVID-19 study performance prediction
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation theory and applications.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
KodekX | Application Modernization Development
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
sap open course for s4hana steps from ECC to s4
Encapsulation theory and applications.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Spectroscopy.pptx food analysis technology
Unlocking AI with Model Context Protocol (MCP)
Review of recent advances in non-invasive hemoglobin estimation

Blockchain & Security in Oracle by Emmanuel Abiodun

  • 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Blockchain & Security Emmanuel Abiodun Blockchain Architect Oracle Cloud October 2018 emmanuel.abiodun@oracle.com www.linkedin.com/in/emmanuel-abiodun/ Nov 2018
  • 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Confidential – Oracle Internal/Restricted/Highly Restricted
  • 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction to Oracle Blockchain Cloud Service State Database Enhancements Smart Contract Design Best Practices Some Security Considerations Q&A 1 2 3 4 5 Confidential – Oracle Internal/Restricted/Highly Restricted 4
  • 5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Pre-Assembled Enterprise-Grade Managed Plug and Play Integrations Open Oracle Blockchain Cloud Service 5 ORACLE BLOCKCHAIN CLOUD SERVICE Oracle’s Experience and Expertise
  • 6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Blockchain Cloud Platform 6 Container services Identity Management Services Events Management Services Data Services ORACLE CLOUD INFRASTRUCTURE and PAAS SERVICES ON PREMISES APPS CONSENSUS Validates transactions before adding to chain SMART CONTRACTS Business logic based on agreements DISTRIBUTED LEDGER Whole state data and its history CONFIDENTIALITY Permissioned blockchain with private channels REST API / SDKs for Go, Java, and Javascript ORACLE BLOCKCHAIN PLATFORM Hyperledger Fabric Peers in Customer Datacenters or 3rd Party Clouds External Members SCMERP HCM CX ORACLE SAAS CRM OPEN SOURCE HYPERLEDGER FABRIC 3rd Party SaaS Custom Cloud Apps * Managed PaaS
  • 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Built on Hyperledger Fabric • Clients submit transactions for endorsement to peers • Peers call smart contracts aka chaincode to simulate/endorse transactions • Client submits endorsed transaction to ordering service • Peers validate and commit transactions – Verify policies met and versions for multi-version concurrency control (MVCC) • World state database is a key/value store – Get by key, key range, or partial composite key – Optional databases provide rich queries that can query based upon values Confidential – Oracle Internal/Restricted/Highly Restricted
  • 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Hyperledger Fabric Transaction Flow Client Application Fabric SDK Keys Membership Service Peers Endorser Simulates TX World State Committer Applies changes Ordering Service Certificate Authority 4.0 - Deliver TX Batch Validate Signatures and Authorization Orders TXs into batches according to consensus3.0 - Submit Endorsed TX Includes RWset and endorser signatures Ledger 5.0 – Writes ledger block 5.1 - Updates State Oracle Confidential – Under NDA 6.0 – Commit Notification Smart Contract (Chaincode)
  • 9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle State Database Enhancements • Default state database in Hyperledger Fabric is LevelDB • Optional database supporting rich queries CouchDB – extremely slow • Neither supports isolation, snapshots, or local transactions • Fabric read locks the database for read access during endorsement • Fabric write locks the database for exclusive access during commitment • Result: Endorsement and commitment cannot overlap Hyperledger Fabric Confidential – Oracle Internal/Restricted/Highly Restricted 9
  • 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 10 State Based Enhancements
  • 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle State Database Enhancements • OBCS uses Berkeley Database (BDB) for state database which supports local transactions and isolation • SQL layer on top of BDB for rich queries • Replace database locking with a transaction manager using local txn • Allows endorsement and commitment to execute in parallel • Supports SQL SELECT statements and CouchDB queries in rich queries Confidential – Oracle Internal/Restricted/Highly Restricted
  • 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12 Smart Contract Design Best Practices
  • 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | OABCS Application Design Best Practices • Start small • Keep it simple • Not everything belongs on a ledger • Workflow is best done in the application, not smart contracts • L10N I18N • Pull instead of push • Determine who you trust and how much you trust them Confidential – Oracle Internal/Restricted/Highly Restricted
  • 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Not Everything Belongs on the Ledger • Blockchains replicate the ledger – potentially many copies • For large objects, this dramatically increases storage requirements • Store what’s absolutely needed and must be shared • Large objects or PII should be stored off-chain if possible – Store them elsewhere – Place hash of object on the ledger as proof – Mediate off-chain storage access via the blockchain Confidential – Oracle Internal/Restricted/Highly Restricted
  • 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Workflow in the Application, not Smart Contracts • Ledger records the transactions • Workflow such as multi-step processes best left to external tools • Examples: – Voting to add new member to blockchain network • the state of the votes is maintained on blockchain • Acting on the vote is a workflow issue • Use events to move workflow forward Confidential – Oracle Internal/Restricted/Highly Restricted
  • 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Who Do You Trust and How Much Do You Trust Them? • This determines many design decisions such as: • Endorsement policies – who needs to validate transactions • How confidential is the data? – Peers running outside Oracle cloud can snoop data – By default, any user can read ledger Confidential – Oracle Internal/Restricted/Highly Restricted
  • 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Agenda Introduction to Blockchain and Smart Contracts CargoSmart OABCS Application Design Best Practices Hyperledger Fabric Smart Contract best practices Summary and Q&A 1 2 3 4 5 Confidential – Oracle Internal/Restricted/Highly Restricted 17
  • 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Hyperledger Fabric Smart Contracts • Smart contracts provide the cross organization business logic • Similar to stored procedures • Executed multiple times • Only thing that update world state • Written in Go, Node.js, and Java Confidential – Oracle Internal/Restricted/Highly Restricted
  • 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Smart Contract Mandatory Practice • Deterministic! – Do NOT generate guids, random numbers,… – Do NOT try to the get the time • If needed have client pass in: – guids, random numbers, timestamps,… – Data from external systems • Watch for timeouts Confidential – Oracle Internal/Restricted/Highly Restricted Better than best practices
  • 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Avoid Data Hot Spots or Global Keys • Keys that are read and written frequently – Sequence number – Totals • Likely cause invalidation errors – Especially for larger block sizes • Higher likelihood for MVCC errors – Transactions have to be retried Confidential – Oracle Internal/Restricted/Highly Restricted Performance
  • 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | World State Access • Watch for phantom reads – Standard Fabric rich queries don’t affect RWset – OBCS rich queries are re-executed at validation time • Create indexes for rich queries • Using OBCS – Use rich queries instead of composite keys – Push summaries, calculations, etc., down to database • Average number of marbles owned Confidential – Oracle Internal/Restricted/Highly Restricted
  • 22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Avoid Off Chain Access • Avoid network connections/interactions if possible! – Potential source of non-determinism • Off chain data – Let client provide the data – Store hash in ledger as proof • Off chain applications – Oracles are fine Confidential – Oracle Internal/Restricted/Highly Restricted
  • 23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Push vs Pull • Push – smart contract pushes data – Smart contract updating an external application – But will be called multiple times – once for each endorsement • Pull – application pulls data – External application calls smart contract to put data – Can maintain queue in world state – Use a chaincode event to trigger – Receiving application pulls the data from the blockchain Confidential – Oracle Internal/Restricted/Highly Restricted
  • 24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Circuit Breakers • Emergency stop • Essentially denies all executions until reset • Commonly used to deal with serious bugs or security issues • Controlled by limited parties, e.g. admins Confidential – Oracle Internal/Restricted/Highly Restricted
  • 25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Side DB Confidential – Oracle Internal/Restricted/Highly Restricted Peer3 Chaincode State hash(k1), hash(secret value) Private State k1, secret value Channel 1 Peers in collection Peer2 Peers not in collection Gossip Chaincode State hash(k1), hash(secret value) Private State k1, secret value Chaincode State hash(k1), hash(secret value) Peer1 Endorsing Committing Endorsing Committing Committing only Private state among subset of peers
  • 26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 26 Some Security Considerations
  • 27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Privacy and Confidentiality • Only put what’s necessary on the ledger! • All peers get a copy, consider where peers run • Encrypt data or store sensitive data off chain • Choose strong encryption – quantum computing is coming • Use side database feature of Fabric – Only specific peers get private data, hash of key/value recorded in ledger • Soon: Anonymous Authentication and Zero-Knowledge Asset Transfer Confidential – Oracle Internal/Restricted/Highly Restricted
  • 28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Privacy and Confidentiality • Normally any authorized user has access to ledger • Use Fabric fine grained access control – Prohibit or limit access to query system chaincode and events – Only allow access via invoking smart contracts • Implement fine grained access control in chaincode – Take control of who has access to what – Maintain the access information in chaincode – Field level access control, attribute access control • Use transient data to pass in data to be excluded from the ledger Confidential – Oracle Internal/Restricted/Highly Restricted Keep prying eyes out
  • 29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Security • Use static analysis tools • Use SSL/TLS to protect communication • Check everything! – all needed arguments – Injection attacks – Verify identity Confidential – Oracle Internal/Restricted/Highly Restricted
  • 30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Security • Docker isolation is not enough • Kata containers use in multi-tenancy • Ensure customer can harm only himself • Careful with platform / env secrets Confidential – Oracle Internal/Restricted/Highly Restricted
  • 31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 31 Questions?

Editor's Notes

  • #6: Pre-assembled – Hyperledger Fabric blockchain network components, identity mgmt., event mgmt., container lifecycle mgmt., object store, and all infrastructure dependencies Open - Built on open-source Hyperledger fabric software from the Linux Foundation, interconnects with non-Oracle HL Fabric instances, supports REST APIs and Fabric client SDKs Plug and play integration – OIC adapters for Oracle and 3rd party apps with diverse systems of record and REST APIs Enterprise-grade - Improved resilience with HA, 99.95% availability SLA, enhanced security, & continuous ledger backup Autonomous - Industry’s 1st and only autonomous blockchain cloud service Expertise and Experience – Experience building blockchain solutions for many industries that leverage our deep industry expertise & partners trained on Oracle blockchain