Drupal and the Ethereum Blockchain

#DrupalEthereum @digitaldonkey09

About me

  • about 20 years ​​web development  
  • 10+ years with Drupal
  • 2 years in Ethereum 
  • Developer at ConsenSys 

@digitaldonkey09

Overview

  • What is a Blockchain
  • Ethereum ecosystem
  • Blockchain components
  • Drupal Ethereum Architecture & outlook

Blockchain

a simplified introduction

  • Banks improve interbank settlement
  • Governments exploring paperless e-government and registries
  • Healthcare/Insurance - sharing evidence, verified prescriptions
  • Law - investigating the legal side of "smart contracts"
  • Energy - incentivizing energy efficiency and trading
  • IoT - Internet of things, sensors, appliances
  • NGOs - transparency in international aid & outcomes

Who cares about Blockchain?

Blockchain's promises

"Sharing Economy" of
Uber, Airbnb, Spotify

Centralized User Data,
Facebook, Google

Reduce
Middlemen

Self-sovereign
user identity

Internet of
Information

Don Tapscott: "How the Blockchain is changing money and business"

Internet of
Value & Trust

Imagine the Blockchain as a
"Decentralized Consensus Database"

"0xd62e7da1d30af2abed70f0ec677fefe0a0db5774  owns 5 Bitcoin"

agree
agree
agree
agree
agree
agree

Ethereum is an open-source, public,
     blockchain-based distributed computing
     platform
 featuring smart contract functionality.

Ethereum Blockchain

Decentralized
P2P consensus

No central authority

 

Any state change requires a cryptographically signed Transaction

Global ledger with immutable records

Programmable money:
Smart Contracts

Transactions, Blocks & chaining

Data in Blockchain is public.

  • Interpretable when knowing the contract ABI (Application Binary Interface).

"Writing to Blockchain" requires:

  • the private key of the from address to sign the transaction
  • some fee for computation/data storage in Ether (public chain)

time

Smart Contracts in Ethereum

Contract crowdFound
 if (account_balance) > $10,000
   move account_balance to founded_account
 else
   move donation_account to original_donor

(pseudocode)

Smart contracts are applications with a state stored in the blockchain

  • can run automatically when certain conditions are met
  • Addressable, can handle money / escrow, Turing-complete
  • Crowd founding as a Smart Contract:

Signing & Signatures

  • Public and private keys like in PGP
  • Signing requires user interaction (if you don't host the keys      )
  • Ethereum Address is derived from the private key
  • Signing Transactions (means also deploy code)
  • Signing text (Signatures)
  • Encryption (Similar to PGP)

Transaction Signers

  • Mist browser   (Full Blockchain)
  • Metamask   (Browser extension)
    Coming up: MetaMascara (browser independent)
  • uPort   (Identity provider)
  • MyEthereumWallet   (Online or Offline browser)
  • Jaxx (Mobile App & Browser extension)
  • Hardware based signing (Ledger wallet)

Ethereum wallets, Identity providers ... 

Two signup modules?

Ethereum Signup

  • Challenge/response authentication
  • No Blockchain interaction - no fee
    Just Elliptic Curve cryptography

Ethereum user connector

  • Smart contract with registry
  • May be changed to a paywall
  • Transaction require little payment in Ether

Architecture challenges

Ethereum ecosystem summary

  • Public Ethereum Blockchain or
    private/consortium chains can be used
  • Immutable audit trails for data saved in blockchain
  • Smart contract code is deployed to the blockchain
  • Ether is the currency in Ethereum:
      Anti-spam and incentive to run the public network        

Challenges

  • Still evolving (Solidity 0.4.17)
  • Improve Ethereum TX trough-put                              
  • TX-Signers / Cross-browser availability of end-user tools
  • Light clients (Chain size is currently about 280GB)
    https://etherscan.io/chart/chaindatasizefull

Drupal Ethereum Module

  • Founded and abandoned in 2014
  • New approach started 2016
  • Ethereum PHP library abstraction
  • POC for signup with registry
  • Currently:
    Focus on infrastructure modules
  • Later:
    maybe out-of-the-box like
    http://bit.ly/drupalvoting

Current web

Ideal decentralization

How to connect Drupal and Ethereum?

Semi-decentralization

Client side signing using Transaction-signers

Server just pulls data

(no private key on Server)

Mapping Ethereum to Drupal

 

Servers (Ethereum-nodes)
List Servers, gather information (Server Entity)


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
  • Let Users interact (→ TX data)

Infrastructure modules

State and Roadmap

Current: POC

Finalizing infrastructure modules (MVP)

  • PHP library lacks support of complex data types
  • Make Transaction-signers pluggable & add more 
  • Contract management & deployment from Drupal backend            
  • Server Entities

Drupal Ethereum module

Why should Drupal care about Blockchain?

  • Blockchain provides adds a new trust layer to the internet
  • 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.

thorsten.krug@consensys.net
       @digitaldonkey09

The development of Drupal Ethereum Module
Has been sponsored by ConsenSys

       @ConsenSys

https://consensys.net

slides.com/digitaldonkey/drupal-ethereum-2