SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
sbt-ethereum
> a terminal for the world computer
steve randy waldman — swaldman@mchange.com — https://www.sbt-ethereum.io/ — https://www.interfluidity.com/ — @interfluidity
the blockchain is the dApp
Remember this?
...The Times 03/Jan/2009 Chancellor
on brink of second bailout for banks...
meanwhile...
4 We've internalized the
infantilizing norms of
contemporary Silicon Valley.
4 Just wait for "us" (the "devs!",
the "team!", "VCs!") to build
you ("end users!") something
complicated and awesome!
meanwhile...
4 It's gonna take a lot of time and
money, because "end users!"
need an awesome "UX!"
4 Every experiment requires a
funded startup and scale
sufficient to justify that
4 So we run tens of big, expensive
experiments rather than
thousands of small, cheap ones
the blockchain is the dApp
But...
4 Ethereum smart contracts expose a UI automatically
4 It's called an ABI
4 Smart contracts take an order of magnitude less effort to write
than the Web, mobile, and UX stuff in which people surround them
4 We should prefer a world with many small-scale economic
arrangements to one with a few, standard large-scale ones
the blockchain is the dApp
4 Sophisticated "end users" can deploy and interact
with smart contracts directly, and take full control
4 Less sophisticated users can rely upon humans whom
they directly know as helpers and intermediaries
4 Eventually, intermediary roles can be smoothed and
automated away. But that's eventually.
sbt-ethereum
4 A convenient, high-level, text-based user interface
for interacting with Ethereum and compatible
blockchains
4 A smart-contract development and deployment tool
4 A high-performance framework for integrating
smart contracts into Scala applications
4 A platform for developing app-specific CLIs
very stateful
sbt-ethereum collects and retains...
4 Node URLs
4 Wallets, addresses, and address aliases
4 ABIs and ABI aliases
4 Default mappings of ABIs to smart contracts
4 Complete compilation info about deployed contracts
friendly (sort of)
4 Tab-completey
4 Often interactive
4 Very long but descriptive names
4 Consistent internal conventions
4 Default values and session overrides
4 Set, Drop, Print
friendly (sort of)
Get started with a few basic commands
> ethContractAbiImport <address-as-hex-alias-or-ens>
> ethTransactionView <address-as-hex-alias-or-ens> <function-args>*
> ethTransactionInvoke <address-as-hex-alias-or-ens> <function-args>*
> ethTransactionEtherSend <address-as-hex-alias-or-ens>
> ethAddressBalance [optional-address-as-hex-alias-or-ens]
> ethAddressAliasSet <alias-name> <address-as-hex-alias-or-ens>
batteries included
ENS
4 ENS can be used in place of addresses and address
aliases
4 Acts as a full ENS client, including registering
names, extending registrations, creating subnodes,
transfering ownership, etc.
batteries included
ERC-20
4 Built in support for managing ERC-20 tokens using
human-friendly values as defined in the decimals()
function
Etherscan
4 Autoimport ABIs of verified contracts if an
Etherscan API key has bee set.
powerful
4 Full smart-contract development environment
4 Supports signing for EIP-155 chain IDs and seamless
switching between chains
4 Offline transaction-signing for cold wallets
4 Sophisticated control of gas and nonces
4 Name and store reusable ABIs
4 Overlay arbitrary ABIs on top of any contract
programming (Scala-centric)
4 Automatic stub generation
4 Thread-pool managed async stubs or easy-to-
understand synchronous stubs
4 Solidity-like embedded DSL
4 Solidity events become typesafe, pattern-
matchable Scala objects
4 Standard "reactive" filter-free event subscriptions
programming (Scala-centric)
contract DocHashStore {
event Stored( bytes32 docHash, uint timestamp, string name, string description, address filer );
event Amended( bytes32 docHash, string name, string description, address updater, uint priorUpdateBlockNumber );
event Opened( address admin, uint timestamp );
event Closed( address closer, uint timestamp );
event Authorized( address user );
event Deauthorized( address user );
address public admin;
bytes32[] public docHashes;
mapping ( address => bool ) public authorized;
uint public openTime;
uint public closeTime;
bool public closed;
function close() public;
function authorize( address filer ) public;
function deauthorize( address filer ) public;
function canUpdate( address user ) public view returns (bool);
function store( bytes32 docHash, string memory name, string memory description ) public;
function amend( bytes32 docHash, string memory name, string memory description ) public;
function isStored( bytes32 docHash ) public view returns (bool);
function timestamp( bytes32 docHash ) public view returns (uint);
function name( bytes32 docHash ) public view returns (string memory);
function description( bytes32 docHash ) public view returns (string memory);
function filer( bytes32 docHash ) public view returns (address);
function size() public view returns (uint);
}
programming (Scala-centric)
// for simplicity, this example builds a synchronous DocStoreHash
// if we called AsyncDocStoreHash.build(...) instead, the same code would work
// but all stub return values would be Futures
val docstore = DocHashStore.build( jsonRpcUrl = "https://mainnet.infura.com/v3/20963efa809b0178",
chainId = Some(EthChainId.Mainnet),
contractAddress = EthAddress("0x1a4934109b54911a724dfa0e45d5370dbbe923b0") )
implicit val sender = stub.Sender.Basic( somePrivateKey )
val sz = docstore.view.size()
val docHash = sol.Bytes32( "0x00e2b1120d2c76a3b44640c325681c892dd3a1fcb33bf412169a2c17f5e0c171".decodeHex )
val txnInfo = docstore.txn.store( docHash, "ImportantDocument.pdf", "This is a really important document" )
programming (Scala-centric)
// inside a standard org.reactivestreams.Subscriber[DocHashStore.Event]
def onNext(evt : DocHashStore.Event) = {
evt match {
case _ : Stored | _ : Amended => markDirtyDocRecordSeq( address )
case _ : Closed => {
markDirtyOpenClose( address )
subscriptionRef.get.foreach( _.cancel() )
drop( address )
}
case evt @ Authorized( userAddress ) => markDirtyUserCanUpdate( evt.sourceAddress, userAddress )
case evt @ Deauthorized( userAddress ) => markDirtyUserCanUpdate( evt.sourceAddress, userAddress )
case _ => DEBUG.log( s"${this} encountered and ignored event ${evt}" )
}
}
demo
support
4 Decent documentation at www.sbt-ethereum.io
4 Tag sbt-ethereum on ethereum.stackexchange.com
4 DM @interfluidity on Twitter
4 E-mail swaldman@mchange.com
4 swaldman/sbt-ethereum on GitHub
support me
4 Use the software
4 Tell me what sucks so I can fix it
4 especially if anything sucks related to security
4 If you want to offer financial support, get in touch,
or contribute to sbt-ethereum.eth
acknowledgments
Waiting for Godot image nicked from
4 https://www.onecolumbiasc.com/event/waiting-for-godot/

Weitere ähnliche Inhalte

Was ist angesagt?

Chatting dengan beberapa pc laptop
Chatting dengan beberapa pc laptopChatting dengan beberapa pc laptop
Chatting dengan beberapa pc laptop
yayaria
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
julien pauli
 
Twisted logic
Twisted logicTwisted logic
Twisted logic
ashfall
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
julien pauli
 

Was ist angesagt? (20)

Creating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareCreating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and software
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 Verona
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
 
Chatting dengan beberapa pc laptop
Chatting dengan beberapa pc laptopChatting dengan beberapa pc laptop
Chatting dengan beberapa pc laptop
 
Redis - Usability and Use Cases
Redis - Usability and Use CasesRedis - Usability and Use Cases
Redis - Usability and Use Cases
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
 
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy CresineIntroduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy Cresine
 
An (abridged) Ruby Plumber's Guide to *nix
An (abridged) Ruby Plumber's Guide to *nixAn (abridged) Ruby Plumber's Guide to *nix
An (abridged) Ruby Plumber's Guide to *nix
 
Twisted logic
Twisted logicTwisted logic
Twisted logic
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performances
 
Clojure and the Web
Clojure and the WebClojure and the Web
Clojure and the Web
 
PHP 7 OPCache extension review
PHP 7 OPCache extension reviewPHP 7 OPCache extension review
PHP 7 OPCache extension review
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
Ravada VDI Eslibre
Ravada VDI EslibreRavada VDI Eslibre
Ravada VDI Eslibre
 
Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7
 
Web Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWeb Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The Basics
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
 

Ähnlich wie sbt-ethereum: a terminal for the world computer

Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Shakacon
 

Ähnlich wie sbt-ethereum: a terminal for the world computer (20)

BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureCréer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
 
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain
 
Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...
Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...
Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...
 
Basics of C
Basics of CBasics of C
Basics of C
 
Kotlin coroutines and spring framework
Kotlin coroutines and spring frameworkKotlin coroutines and spring framework
Kotlin coroutines and spring framework
 
OpenSSL Basic Function Call Flow
OpenSSL Basic Function Call FlowOpenSSL Basic Function Call Flow
OpenSSL Basic Function Call Flow
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Build dapps 1:3 dev tools
Build dapps 1:3 dev toolsBuild dapps 1:3 dev tools
Build dapps 1:3 dev tools
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
web3j Overview
web3j Overviewweb3j Overview
web3j Overview
 
[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline
 
EC2 Storage for Docker 150526b
EC2 Storage for Docker   150526bEC2 Storage for Docker   150526b
EC2 Storage for Docker 150526b
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
 
Impala: A Modern, Open-Source SQL Engine for Hadoop
Impala: A Modern, Open-Source SQL Engine for HadoopImpala: A Modern, Open-Source SQL Engine for Hadoop
Impala: A Modern, Open-Source SQL Engine for Hadoop
 

Mehr von Steve Waldman

Mehr von Steve Waldman (11)

Like Uber, But For Slavery: The Power Of Fiat Money
Like Uber, But For Slavery: The Power Of Fiat MoneyLike Uber, But For Slavery: The Power Of Fiat Money
Like Uber, But For Slavery: The Power Of Fiat Money
 
a tao of decentralization
a tao of decentralizationa tao of decentralization
a tao of decentralization
 
Agency — a perspective on social affairs
Agency — a perspective on social affairsAgency — a perspective on social affairs
Agency — a perspective on social affairs
 
fiat money is very effective
fiat money is very effectivefiat money is very effective
fiat money is very effective
 
Engineering Authority
Engineering AuthorityEngineering Authority
Engineering Authority
 
Rebuilding finance from the bottom up
Rebuilding finance from the bottom upRebuilding finance from the bottom up
Rebuilding finance from the bottom up
 
An Introduction to Fiat Money
An Introduction to Fiat MoneyAn Introduction to Fiat Money
An Introduction to Fiat Money
 
Engineering Economic Security
Engineering Economic SecurityEngineering Economic Security
Engineering Economic Security
 
Cryptoasset Valuation for Designers
Cryptoasset Valuation for DesignersCryptoasset Valuation for Designers
Cryptoasset Valuation for Designers
 
Perspectives on a Universal Basic Income
Perspectives on a Universal Basic IncomePerspectives on a Universal Basic Income
Perspectives on a Universal Basic Income
 
Soylent Blockchains
Soylent BlockchainsSoylent Blockchains
Soylent Blockchains
 

Kürzlich hochgeladen

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

sbt-ethereum: a terminal for the world computer

  • 1. sbt-ethereum > a terminal for the world computer steve randy waldman — swaldman@mchange.com — https://www.sbt-ethereum.io/ — https://www.interfluidity.com/ — @interfluidity
  • 2. the blockchain is the dApp Remember this? ...The Times 03/Jan/2009 Chancellor on brink of second bailout for banks...
  • 3. meanwhile... 4 We've internalized the infantilizing norms of contemporary Silicon Valley. 4 Just wait for "us" (the "devs!", the "team!", "VCs!") to build you ("end users!") something complicated and awesome!
  • 4. meanwhile... 4 It's gonna take a lot of time and money, because "end users!" need an awesome "UX!" 4 Every experiment requires a funded startup and scale sufficient to justify that 4 So we run tens of big, expensive experiments rather than thousands of small, cheap ones
  • 5. the blockchain is the dApp But... 4 Ethereum smart contracts expose a UI automatically 4 It's called an ABI 4 Smart contracts take an order of magnitude less effort to write than the Web, mobile, and UX stuff in which people surround them 4 We should prefer a world with many small-scale economic arrangements to one with a few, standard large-scale ones
  • 6. the blockchain is the dApp 4 Sophisticated "end users" can deploy and interact with smart contracts directly, and take full control 4 Less sophisticated users can rely upon humans whom they directly know as helpers and intermediaries 4 Eventually, intermediary roles can be smoothed and automated away. But that's eventually.
  • 7. sbt-ethereum 4 A convenient, high-level, text-based user interface for interacting with Ethereum and compatible blockchains 4 A smart-contract development and deployment tool 4 A high-performance framework for integrating smart contracts into Scala applications 4 A platform for developing app-specific CLIs
  • 8. very stateful sbt-ethereum collects and retains... 4 Node URLs 4 Wallets, addresses, and address aliases 4 ABIs and ABI aliases 4 Default mappings of ABIs to smart contracts 4 Complete compilation info about deployed contracts
  • 9. friendly (sort of) 4 Tab-completey 4 Often interactive 4 Very long but descriptive names 4 Consistent internal conventions 4 Default values and session overrides 4 Set, Drop, Print
  • 10. friendly (sort of) Get started with a few basic commands > ethContractAbiImport <address-as-hex-alias-or-ens> > ethTransactionView <address-as-hex-alias-or-ens> <function-args>* > ethTransactionInvoke <address-as-hex-alias-or-ens> <function-args>* > ethTransactionEtherSend <address-as-hex-alias-or-ens> > ethAddressBalance [optional-address-as-hex-alias-or-ens] > ethAddressAliasSet <alias-name> <address-as-hex-alias-or-ens>
  • 11. batteries included ENS 4 ENS can be used in place of addresses and address aliases 4 Acts as a full ENS client, including registering names, extending registrations, creating subnodes, transfering ownership, etc.
  • 12. batteries included ERC-20 4 Built in support for managing ERC-20 tokens using human-friendly values as defined in the decimals() function Etherscan 4 Autoimport ABIs of verified contracts if an Etherscan API key has bee set.
  • 13. powerful 4 Full smart-contract development environment 4 Supports signing for EIP-155 chain IDs and seamless switching between chains 4 Offline transaction-signing for cold wallets 4 Sophisticated control of gas and nonces 4 Name and store reusable ABIs 4 Overlay arbitrary ABIs on top of any contract
  • 14. programming (Scala-centric) 4 Automatic stub generation 4 Thread-pool managed async stubs or easy-to- understand synchronous stubs 4 Solidity-like embedded DSL 4 Solidity events become typesafe, pattern- matchable Scala objects 4 Standard "reactive" filter-free event subscriptions
  • 15. programming (Scala-centric) contract DocHashStore { event Stored( bytes32 docHash, uint timestamp, string name, string description, address filer ); event Amended( bytes32 docHash, string name, string description, address updater, uint priorUpdateBlockNumber ); event Opened( address admin, uint timestamp ); event Closed( address closer, uint timestamp ); event Authorized( address user ); event Deauthorized( address user ); address public admin; bytes32[] public docHashes; mapping ( address => bool ) public authorized; uint public openTime; uint public closeTime; bool public closed; function close() public; function authorize( address filer ) public; function deauthorize( address filer ) public; function canUpdate( address user ) public view returns (bool); function store( bytes32 docHash, string memory name, string memory description ) public; function amend( bytes32 docHash, string memory name, string memory description ) public; function isStored( bytes32 docHash ) public view returns (bool); function timestamp( bytes32 docHash ) public view returns (uint); function name( bytes32 docHash ) public view returns (string memory); function description( bytes32 docHash ) public view returns (string memory); function filer( bytes32 docHash ) public view returns (address); function size() public view returns (uint); }
  • 16. programming (Scala-centric) // for simplicity, this example builds a synchronous DocStoreHash // if we called AsyncDocStoreHash.build(...) instead, the same code would work // but all stub return values would be Futures val docstore = DocHashStore.build( jsonRpcUrl = "https://mainnet.infura.com/v3/20963efa809b0178", chainId = Some(EthChainId.Mainnet), contractAddress = EthAddress("0x1a4934109b54911a724dfa0e45d5370dbbe923b0") ) implicit val sender = stub.Sender.Basic( somePrivateKey ) val sz = docstore.view.size() val docHash = sol.Bytes32( "0x00e2b1120d2c76a3b44640c325681c892dd3a1fcb33bf412169a2c17f5e0c171".decodeHex ) val txnInfo = docstore.txn.store( docHash, "ImportantDocument.pdf", "This is a really important document" )
  • 17. programming (Scala-centric) // inside a standard org.reactivestreams.Subscriber[DocHashStore.Event] def onNext(evt : DocHashStore.Event) = { evt match { case _ : Stored | _ : Amended => markDirtyDocRecordSeq( address ) case _ : Closed => { markDirtyOpenClose( address ) subscriptionRef.get.foreach( _.cancel() ) drop( address ) } case evt @ Authorized( userAddress ) => markDirtyUserCanUpdate( evt.sourceAddress, userAddress ) case evt @ Deauthorized( userAddress ) => markDirtyUserCanUpdate( evt.sourceAddress, userAddress ) case _ => DEBUG.log( s"${this} encountered and ignored event ${evt}" ) } }
  • 18. demo
  • 19. support 4 Decent documentation at www.sbt-ethereum.io 4 Tag sbt-ethereum on ethereum.stackexchange.com 4 DM @interfluidity on Twitter 4 E-mail swaldman@mchange.com 4 swaldman/sbt-ethereum on GitHub
  • 20. support me 4 Use the software 4 Tell me what sucks so I can fix it 4 especially if anything sucks related to security 4 If you want to offer financial support, get in touch, or contribute to sbt-ethereum.eth
  • 21. acknowledgments Waiting for Godot image nicked from 4 https://www.onecolumbiasc.com/event/waiting-for-godot/