Beyond the Bubble – Blockchain Applications and the Drupal Ethereum Module
#DrupalEthereum @digitaldonkey09
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4867978/druplicon_luvs_ny_1.png)
Drupal NYC Meetup
About me
- 20 years web development
- 10+ years with Drupal
- 2+ years in Ethereum
- Developer at ConsenSys
Overview
- What is a Blockchain
- Ethereum Blockchain
- Drupal Ethereum Module
- Launching Daap's
- Discuss Blockchain applications
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739258/EthEntAliance.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4869612/cnbc-regulations.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4869615/cnn.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4869617/Fed.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4869620/nyt-beyond-the-bubble.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4869622/swiss-info.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3742648/uk-gove-report.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739257/sheik-tweet.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4870360/berners-lee-fortune.png)
- Law - investigating the legal side of "smart contracts" and tokens
- NGOs - transparency in international aid & outcomes
- Banks trying to improve their interbank settlement
- Governments exploring digital IDs and e-government
- Healthcare - sharing evidence, verified prescriptions
- Energy - incentivizing energy efficiency and trading
- IoT - Internet of things, sensors, appliances
Who cares about Blockchain?
What's a Blockchain?
Imagine the Blockchain as a
"Decentralized & Distributed Consensus Database"
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721035/database-512.png)
"0xd62e7da1d30af2abed70f0ec677fefe0a0db5774 owns 5 Bitcoin"
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721113/speech-bubble-512.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721113/speech-bubble-512.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721216/speech-bubble-512-left.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721216/speech-bubble-512-left.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721216/speech-bubble-512-left.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3721113/speech-bubble-512.png)
agree
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728392/Bitcoin_Logo.png)
Blockchain's promises
"Sharing Economy" of
Uber, Airbnb
Centralized User Data,
Facebook, Google
Reduce costs of
middlemen
Self-sovereign
user identity
Internet of
Information
Don Tapscott: "How the Blockchain is changing money and business"
Internet of
Trust and Value
Digital Identity Today
Is proprietary / Isn't self owned
- Facebook / Google
- Visa, Master, Bank account
-
Equifax-> Random hackers - State IDs / Passports
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4870264/fingerprint.png)
You pay for your "free" online identity by exposing your privacy
You can be excluded ("You may leave if you don't like the new Terms & conditions")
Self Sovereign Identity
The Idea of decentralized identifier (DID)
- You create a claim:
"My address is 949 Metropolitan Av, Brooklyn" - Others attest your claim:
"New York State verifies that this person is registered at this address with the offical NYS signature" - As a developer you would chose which attestation entities you consider trustworthy
Many people work on this
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4870264/fingerprint.png)
- uPort (ConsenSys)
- Blockstack
- http://www.weboftrust.info
- http://identity.foundation
- https://sovrin.org
- https://www.civic.com
Blockchain Applications
The decentralized long term perspective
- Peer-to-peer Music / [add our digital good here] markets
- Decentralizing Energy infrastructure
- Asset Management: Trade Processing and Settlement
- Supply chain records
- Self governed organizations
- Tokenized ownership
- Peer-to-peer standards for Airbnb, Über ...
- Fix Journalism
- Self sovereign identity
- Digital IDs (uPort piloted at "Zug ID" in Swiss)
Blockchain Applications
Lower hanging fruits
- Payments, Money transfers
- Paywall, Micropayment
- Donations, tipping
- Signature Systems - everything requiring a signature
- Bounties
- Subscriptions Services (EIP-948)
- Voting
⇒ Investigate "good" contracts and implement in Drupal.
Ethereum
Ethereum is an open-source, public, blockchain-based distributed computing platform featuring smart contract functionality
Ethereum Blockchain
Decentralized
P2P consensus
No central authority
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728318/network.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728322/coin.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728324/Database-300x300.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728330/publickey.png)
Any state change requires a cryptographically signed Transaction
Global ledger with immutable records
Programmable money:
Smart Contracts
Smart Contracts in Ethereum
- Can run automatically when certain conditions are met
- Addressable, can handle money / escrow, Turing-complete
- Crowd founding as a Smart Contract:
Contract crowdFound
if (account_balance) > $10,000
move account_balance to founded_account
else
move donation_account to original_donor
(pseudocode)
Smart contracts are programs with a state stored on the blockchain
Ethereum - Global or Private
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346749/private-chain.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346763/ethereum-logo.png)
Private Consortium
Blockchain
(permissions, privacy)
Global Public
Blockchain
Transactions, Blocks & chaining
"Writing to Blockchain" requires:
- the private key of the from address to sign the transaction
- some gas fee for computation/data storage in Ether (public chain)
Blocks
- contains a hash of the last block
- are created about every 17 seconds
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3725203/transaction.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739017/TX-to-Block.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739017/TX-to-Block.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739017/TX-to-Block.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739017/TX-to-Block.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3739048/TX-to-Block--dot-dot-dot.png)
time
Ethereum
- Ether is the currency in Ethereum
- Computations cost "gas" (payed in ether) to run
-> anti-spam and incentivize to run the network - Data changes to a blockchain create immutable audit trails
- Blockchain data is public! (on public chains, if not encrypted)
- Smart Contracts: Code deployed to the blockchain that can control funds
- Private-/public key cryptography like in PGP
Signing & Signatures
- Asymmetrical/public key cryptography
- Signing requires user interaction (if you don't host the keys )
- Ethereum Address is derived from the private key
- Signing Transactions (writing anything to the blockchain is a transaction, also sending money, deploying code)
- Signing text (Signatures)
- You may use the key for Encryption (Similar to PGP)
- Any account is independent from the network
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4156062/bw-lock-broken.png)
Transaction Signers
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3725248/metamask-transaction.png)
- Mist browser (Full Blockchain / Ethereum foundation)
- Metamask (Browser extension)
- MetaMascara (Metamask in Browser)
- uPort (Identity provider)
- MyEthereumWallet (Online or Offline Browser)
- Jaxx (Mobile App & Browser extension)
- Hardware based signing (Ledger wallet)
Ethereum wallets, Identity providers ...
Literally the key for the user
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3734009/Drupal-ethereum-module.png)
Drupal Ethereum Module
- Founded and abandoned in 2014
- New approach started 2016
- PHP Library (Ethereum-PHP)
- POC for signup with registry (8.1.x)
-
Currently finalizing infrastructure
- Manage Networks and Contracts
- Ethereum Signup
- Ethereum User connector
Current web
Ideal decentralization
How to connect Drupal and Ethereum?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3728846/Ethereum-ideal.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3733268/current-architecture.png)
Semi-decentralization
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3300559/semi-decentralized.png)
Client side signing using Transaction-signers
Server just pulls data
(no private key on Server)
Architecture challenges
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4158910/architecture-challenges.png)
Ethereum-PHP Library
- Abstract Ethereum JsonRPC API
- strict Datatypes, keccak hash , EC-Verify in PHP
- SmartContract Objects
- Lots of tests, ability to test against smart contracts
- API documentation: http://ethereum-php.org
- https://packagist.org/packages/digitaldonkey/ethereum-php
- TODOs
- complex data types (Arrays + Lists
- Sustainable EC-verify
- Testing framework for PHP library for various Ethereum clients
Mapping Ethereum to Drupal
Infrastructure modules
Servers (Ethereum-nodes)
List Servers, gather information (Server Entity)
Deployability, Testability
Accounts
Ethereum Addresses
Map Accounts to Drupal Accounts
➡ Identity for known user group
Transactions
Read (own contracts/known ABI)
Log TX based on Contract interaction
Process TX data in Drupal
Smart Contracts
Manage deploy as Drupal Admin
Provide ABI to process data in Drupal & frontend
Watch for Blockchain Events triggers by Contracts
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346723/icon--nodes.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346724/icon--account.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346725/icon--smartContract.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346726/icon--signature.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4873828/ManageNetwork.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4873824/ManageNetwork-editNode.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4873830/UserConnectorConfig.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4873819/ManageContract.png)
Two signup modules?
Ethereum Signup
- Challenge/response authentication
- No Blockchain interaction - no fee
Just Elliptic Curve cryptography - Uses externalauth module
Ethereum user connector
- Smart contract with registry
- May be changed to a paywall
- Transaction require little payment in Ether
- Example module for contract interaction
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346713/icon--signature-white.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4346716/icon--smartContract-white.png)
Mascara & Dapp launcher
current pluggable TX signer solution
- Dapp is a acronym for decentralized app
- Metamask Mascara allows TX signing without Browser extension
- Mascara Wrapper:
- Evaluate a common way for blockchain interaction
- Make sure the user
- is on the right network
- has unlocked his account (if you need his address)
- Experiment interaction UX and develop standards for Blockchain
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4871098/mascara-wrapper-UML.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4871091/mascara-wrapper-ui.gif)
Mascara & Dapp launcher
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4871134/App-init-example.png)
Visualize TX signer state
Initialize dapplet when requirements are met
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4873537/Drupal-architecture-diagram.png)
Architecture summary
State and Roadmap
POC (done)
- "User connector" connects Ethereum accounts and user profiles via registry contract ("paywall"). Refactoring to new infrastructure.
See Video https://youtu.be/Y5Sa7QtpXSE - Identity: "Signup" (currently in github feature-ethereum_signup)
Finalizing infrastructure modules (MVP)
- Refactor above to match the new Infrastructure
(Mostly done. Results in much less code compared to POC) - Finalize Ethereum-PHP library
- Add more Transaction-signers. Explore and improve UX
- Contract deployment from Drupal backend (Maybe implement Remix)
Drupal Ethereum module
Why should Drupal care about Blockchain?
- Blockchain adds a new trust layer to the internet (we call it web3)
- Drupal can provide Identity in context of limited user groups
- Implement enterprise level workflows, required for Document signing, Peer-to-peer platforms, Asset tracking ...
- Explore new ways of NGO founding, budgeting, voting.
- Investigate future payment methods.
- Pioneer new blockchain based business models
Lots of Thanks to early
contributors & testers
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/4870672/contributors.png)
and all others I talked to
(Commit stats refer to the various involved projects)
Questions & Thank You
-
Evaluate use cases, join discussion
https://gitter.im/drupal_ethereum
https://groups.drupal.org/ethereum - Tweet about #DrupalEthereum
thorsten.krug@consensys.net
@digitaldonkey09
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3733188/twitter-128.png)
The development of Drupal Ethereum Module
Has been sponsored by ConsenSys
@ConsenSys
![](https://s3.amazonaws.com/media-p.slid.es/uploads/76781/images/3733188/twitter-128.png)
https://consensys.net
slides.com/digitaldonkey/drupal-ethereum-nyc
Drupal Camp NYC - Beyond the Bubble – Blockchain Applications and the Drupal Ethereum Module
By Thorsten Krug
Drupal Camp NYC - Beyond the Bubble – Blockchain Applications and the Drupal Ethereum Module
Presentation about Drupal Ethereum module at Drupal NYC user group May, 2nd 2018
- 1,818