A presentation at Ethereum Classic Summit in October 2019 in Vancouver, BC, Canada by Brooklyn Zelenka
ECIP-1050 S M A RT C O N T R ACT STAT U S C O D E S π€ π C O M P O S I T I O N A L I T Y , I N T E R O P E R A B I L I T Y , A U T O M AT I O N , M E S S A G I N G , A N D M O R E β β¨
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e β’ Cofounder/CTO at Fission β https://fission.codes
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e β’ Cofounder/CTO at Fission β https://fission.codes β’ PLT & VM enthusiast
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e β’ Cofounder/CTO at Fission β https://fission.codes β’ PLT & VM enthusiast β’ Prev. ETH Core Dev, now visiting from IPFS-land π
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e β’ Cofounder/CTO at Fission β https://fission.codes β’ PLT & VM enthusiast β’ Prev. ETH Core Dev, now visiting from IPFS-land π β’ EIPs β’ 615: EVM Subroutines & Static Jumps β’ 902: Token Permissions / Validation β’ 1066: Standardized Status Codes β’ 1444: Permissionless On-Chain Translation
INTRO B R O O K LY N Z E L E N K A , @ e x p e d e β’ Cofounder/CTO at Fission β https://fission.codes β’ PLT & VM enthusiast β’ Prev. ETH Core Dev, now visiting from IPFS-land π β’ EIPs β’ 615: EVM Subroutines & Static Jumps β’ 902: Token Permissions / Validation β’ 1066: Standardized Status Codes β’ 1444: Permissionless On-Chain Translation β’ ECIP 1050
INTRO B I G , H A I RY, AU D A C I O U S G O A L
INTRO B I G , H A I RY, AU D A C I O U S G O A L β’ Write less code π
INTRO B I G , H A I RY, AU D A C I O U S G O A L β’ Write less code π β’ Have higher confidence π
INTRO B I G , H A I RY, AU D A C I O U S G O A L β’ Write less code π β’ Have higher confidence π β’ Make Ethereum more accessible (
INTRO H T T P β E TC
INTRO H T T P β E TC π₯ 404 π»
INTRO H T T P β E TC π₯ 404 π» 0xC4
INTRO R E AS O N S TO CA R E π
INTRO R E AS O N S TO CA R E π β’ Dependency for several ERCs β notably security tokens β’ Approved to be a primitive in Vyper π β’ Flow automation β’ Interoperability β’ Deployed contract reuse (safety!) β’ Open to extension β’ Highly portable β’ Developer & user feedback, incl. (nearly) gas-free localization
STRUCTURED CODES
STRUCTURED CODES SO SIMPLE A MACHINE CAN USE IT ππ€
STRUCTURED CODES TA S T Y N I B B L E S π
STRUCTURED CODES TA S T Y N I B B L E S π 0x41
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 0100 0001
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 Category 0100 0001
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 Category 0100 0001 Reason
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 Category 0100 0001 Reason 0x0B
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 Category 0100 0001 Reason 0x0B 0000 1011
STRUCTURED CODES TA S T Y N I B B L E S π 0x41 Category 0100 0001 Reason 0x0B 0000 1011 (0x0* General is same as just the reason alone)
STRUCTURED CODES C O D E TA B L E
STRUCTURED CODES C O D E TA B L E 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 2 3 4 5 6 7 8 9 A B C D E F
STRUCTURED CODES C O D E TA B L E Category Time Range Auth Agreements Off Chain β¦ 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 2 3 4 5 6 7 8 9 A B C D E F
Category STRUCTURED CODES Time C O D E TA B L E Auth Agreements Off Chain β¦ 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 Reason 2 3 Fail Ok Accepted/Started Action Required β¦ Range 4 5 6 7 8 9 A B C D E F
Category STRUCTURED CODES Time C O D E TA B L E Range Agreements Off Chain β¦ 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 4 5 6 7 8 9 A B C D E F SEARCH / MATCH Reason 2 3 Fail Ok Accepted/Started Action Required β¦ Auth
Category STRUCTURED CODES Time C O D E TA B L E Range Auth Agreements β¦ 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 AWA I T I N G 4 5 6 7 8 9 A B C D E F SEARCH / MATCH Reason 2 3 Fail Ok Accepted/Started Action Required β¦ Off Chain
Category STRUCTURED CODES Time C O D E TA B L E Auth Agreements Off Chain β¦ 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* A* B* C* D* E* F* 0 1 0x23 Awaiting Match 2 3 AWA I T I N G 4 5 6 7 8 9 A B C D E F SEARCH / MATCH Reason Fail Ok Accepted/Started Action Required β¦ Range
STRUCTURED CODES HELPER LIBRARY π npmjs.com/package/fission-codes
STRUCTURED CODES HELPER LIBRARY π npmjs.com/package/fission-codes Combine (inclusions)
STRUCTURED CODES HELPER LIBRARY π npmjs.com/package/fission-codes Combine (inclusions) Pull Apart (projections)
STRUCTURED CODES HELPER LIBRARY π npmjs.com/package/fission-codes Combine (inclusions) Pull Apart (projections) Automatic require with (hardcoded) message*
TOY FLOW
TOY FLOW πΈπ§Έπ°
TOY FLOW N OT R E A DY Y E T
TOY FLOW N OT R E A DY Y E T π° π± π€
TOY FLOW N OT R E A DY Y E T π° π± buy(π°, 10) β π€
TOY FLOW N OT R E A DY Y E T π° buyFor(π€, 10) β π± buy(π°, 10) β π€
TOY FLOW N OT R E A DY Y E T π° buyFor(π€, 10) ππ± β π± buy(π°, 10) β π€
TOY FLOW N OT R E A DY Y E T π° buyFor(π€, 10) ππ± β 0x43 Iβll call you back when ready β π± buy(π°, 10) β π€
TOY FLOW N OT R E A DY Y E T π° π± buy(π°, 10) buyFor(π€, 10) ππ± β 0x43 Iβll call you back when ready β ππ°π€ β π€
TOY FLOW N OT R E A DY Y E T π° π± buy(π°, 10) β buyFor(π€, 10) ππ± β 0x43 Iβll call you back when ready β ππ°π€ 0x43 Iβll call you back when ready β π€
TOY FLOW I M PAT I E N C E π° ππ± π± ππ°π€ π€
TOY FLOW I M PAT I E N C E π° ππ± π± π€ ππ°π€ isDoneYet(π°) β
TOY FLOW I M PAT I E N C E π° ππ± π± π€ ππ°π€ isDoneYet(π°) β 0x43 Iβll call you back when ready β π
TOY FLOW K I C K- O F F π° ππ± π± ππ°π€π§ π€
TOY FLOW K I C K- O F F π° openForBiz() β ππ± π± ππ°π€π§ π€
TOY FLOW K I C K- O F F π° openForBiz() β ππ± 0x41 Ready! β π± ππ°π€π§ π€
TOY FLOW K I C K- O F F π° openForBiz() β ππ± 0x41 π± Ready! β buyFor([π€,π§], 10) β βββ ππ°π€π§ π€
TOY FLOW K I C K- O F F π° openForBiz() β ππ± 0x41 π± Ready! β buyFor([π€,π§], 10) β βββ (0x31, [π€,π§], 10) Agreed & complete β ππ°π€π§ π€
TOY FLOW K I C K- O F F π° openForBiz() β ππ± 0x41 π± Ready! β π€ ππ°π€π§ buyFor([π€,π§], 10) β βββ (0x31, [π€,π§], 10) Agreed & complete β (0x31, π°, 10) Agreed & complete β
TOY FLOW K I C K- O F F π° openForBiz() β ππ± 0x41 π± Ready! β π€ ππ°π€π§ buyFor([π€,π§], 10) β βββ (0x31, [π€,π§], 10) Agreed & complete β (0x31, π°, 10) Agreed & complete β ππ β
M O T I V AT I N G M O R E C O N T E X T
M O T I V AT I N G M O R E C O N T E X T π G R E AT E R T H A N B O O L E A N S π
M O T I V AT I N G M O R E C O N T E X T To make use of a Boolean, you have to know its provenance so that you can know what it means. π π CONOR MCBRIDE [VIA HARPER]
M O T I V AT I N G M O R E C O N T E X T ERC-902
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S π°
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S π° β π€
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S β π€ π° β π€
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S β π€ β π« π° β π€
(false, but donβt explode)
(false, but donβt explode) π
β π€
β π€ β β
(false, but donβt explode) π >
(false, but donβt explode) π β π€
π
β π€ π
β π€ β β π
β π€ β β β π€ β β
(false, but donβt explode) π > β π€ β β π
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S β π€ β π« π° β π€ β β
M O T I V AT I N G M O R E C O N T E X T LOW C O N T E X T B O O L E A N S β π€ β π« π° β β π€ β β
M O T I V AT I N G M O R E C O N T E X T HIGHER CONTEXT β π€ β πΆ π° β β π€ β β
π β π€ β π
β π€ β π π
E π G β π€ β π F β π€ β π πF
USER FEEDBACK
USER FEEDBACK HπJ
USER FEEDBACK EVOLUTION OF revert()
USER FEEDBACK EVOLUTION OF revert() Spieler βBobβ existiert nicht Nicht autorisiert, ΓΌberprΓΌfen Sie mit idcheck.net
USER FEEDBACK O N - C H A I N L O C A L I Z AT I O N Kπ€ Requestor β¬ β¬β¬β‘ LocalizationPreference V S Q P U T R Localization Localization Localization Localization Localization Localization Localization
USER FEEDBACK S U C C E S S F LOW
USER FEEDBACK S U C C E S S F LOW π P
USER FEEDBACK S U C C E S S F LOW π P π€
USER FEEDBACK S U C C E S S F LOW π P tx π€
USER FEEDBACK S U C C E S S F LOW π P tx readOrMutate(β¦) π€
USER FEEDBACK S U C C E S S F LOW π P tx readOrMutate(β¦) 0x11 π€
USER FEEDBACK S U C C E S S F LOW π P tx readOrMutate(β¦) 0x11 β¬ β¬β¬β‘ π€
USER FEEDBACK S U C C E S S F LOW π P tx readOrMutate(β¦) 0x11 textFor(0x11) β¬ β¬β¬β‘ π€
USER FEEDBACK S U C C E S S F LOW π tx P readOrMutate(β¦) 0x11 tx .o ri g in textFor(0x11) β¬ β¬β¬β‘ π€
USER FEEDBACK S U C C E S S F LOW π tx P readOrMutate(β¦) 0x11 tx .o ri g in π€ textFor(0x11) β¬ β¬β¬β‘ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK S U C C E S S F LOW π tx P readOrMutate(β¦) 0x11 tx .o ri g in π€ textFor(0x11) textFor(0x11) β¬ β¬β¬β‘ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK S U C C E S S F LOW π tx P readOrMutate(β¦) 0x11 tx .o ri g in π€ textFor(0x11) textFor(0x11) β¬ β¬β¬β‘ β許γβ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK S U C C E S S F LOW π tx P readOrMutate(β¦) 0x11 tx .o ri g in β許γβ π€ textFor(0x11) textFor(0x11) β¬ β¬β¬β‘ β許γβ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK S U C C E S S F LOW π tx readOrMutate(β¦) β許γβ 0x11 P tx .o ri g in β許γβ π€ textFor(0x11) textFor(0x11) β¬ β¬β¬β‘ β許γβ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK S U C C E S S F LOW AuthorizingContract 許γ π tx readOrMutate(β¦) β許γβ 0x11 P tx .o ri g in β許γβ π€ textFor(0x11) textFor(0x11) β¬ β¬β¬β‘ β許γβ W 0x11 -> βPovolenoβ P 0x11 -> β許γβ V 0x11 -> βAllowedβ
USER FEEDBACK R E V E RT F LOW
USER FEEDBACK R E V E RT F LOW π X
USER FEEDBACK R E V E RT F LOW π X π€
USER FEEDBACK R E V E RT F LOW doTheThing() π€ π X
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ π X
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ revertWith(0x40) π€ π X
USER FEEDBACK R E V E RT F LOW doTheThing() π X tx π€ β¬ β¬β¬β‘ revertWith(0x40) π€
USER FEEDBACK R E V E RT F LOW doTheThing() π X tx π€ textFor(0x40) revertWith(0x40) π€ β¬ β¬β¬β‘
USER FEEDBACK R E V E RT F LOW doTheThing() π X tx π€ textFor(0x40) revertWith(0x40) π€ β¬ β¬β¬β‘ W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ π X tx.origin textFor(0x40) revertWith(0x40) π€ β¬ β¬β¬β‘ W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ π X tx.origin textFor(0x40) revertWith(0x40) π€ β¬ β¬β¬β‘ 0x40 W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ π X tx.origin βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ textFor(0x40) revertWith(0x40) π€ β¬ β¬β¬β‘ 0x40 W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() tx π€ π X tx.origin βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ textFor(0x40) revertWith(0x40) π€ βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ β¬ β¬β¬β‘ 0x40 W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() tx revert(βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ) π€ π X tx.origin βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ textFor(0x40) revertWith(0x40) π€ βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ β¬ β¬β¬β‘ 0x40 W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
USER FEEDBACK R E V E RT F LOW doTheThing() πβΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβπ tx revert(βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ) π€ π X tx.origin βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ textFor(0x40) revertWith(0x40) π€ βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ β¬ β¬β¬β‘ 0x40 W 0x40 -> βProΕ‘lΓ½β X 0x40 -> βΰΊ«ΰΊ‘#ΰΊΰΊΰΊ²ΰΊuβ V 0x40 -> βExpiredβ
WEB OF CONTRACTS
WEB OF CONTRACTS π·
WEB OF CONTRACTS A F U T U R E A LO N G S I D E U N I X & H T T P π
WEB OF CONTRACTS A F U T U R E A LO N G S I D E U N I X & H T T P π β’ What do Unix and HTTP have in common? β’ ETC is a shared system β can we leverage each otherβs contacts? β’ Can high value data & utilities make money on-chain?
WEB OF CONTRACTS ON-CHAIN MICROSERVICES
WEB OF CONTRACTS ON-CHAIN MICROSERVICES dApp ERC902 ACL ERC20 ERC721 Storage DEX ERC1337
WEB OF CONTRACTS ON-CHAIN MICROSERVICES β’ βWeb of contractsβ β’ Leverage shared infrastructure (pluggable) dApp ERC902 ACL ERC20 ERC721 DEX β’ High quality smart contracts β’ Efficient, reviewed, security hardened β’ Compose new protocols β’ New biz models for high-value service contracts Storage ERC1337
https://fission.codes https://tools.fission.codes π THANK YOU, E TC SUMMIT! F brooklyn@fission.codes g i t h u b . c o m /e x p e d e @expede
View ECIP 1050: Smart Contract Status Codes on Notist.
Dismiss