provide data to unlock outputs • Forth-like programming language • Stack based (Left to Right) • First Input Last Output (FILO) • Composed of OP_CODES • Turing incomplete (Purposefully)
parameters of what's needed to spend bitcoins. • Locking script - scriptPubKey • Unlocking script - scriptSig • Bitcoin clients run scriptSig & scriptPubKey to validate each transaction • Scripting system could be used to require two private keys, or a combination of several, or even no keys at all.
or enforce the negotiation or performance of a contract. Smart contracts were first proposed by Nick Szabo in 1996 • Contract (code) written and pushed to Blockchain • Initiates when user sends coin to it • Each node executes smart contract and update the ledger/blockchain • Basically Smart Contracts perform If-this-then-that (IFTTT) operations • Ethereum is one of the widest used platform for Smart Contracts • Smart Contracts also known as Decentralized Application (DApp) • Theoretically any real-world app can be DApp
various blockchain platforms. Developed by Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Yoichi Hirai and several former Ethereum core contributors to enable writing smart contracts on blockchain platforms such as Ethereum. • Turing complete • Based around ECMAScript syntax but statically typed • Runs on Ethereum Virtual Machine (EVM) • Compiles to bytecode before execution • Gas units used to fuel execution (paid by senders of transaction to miners in ether) • Gases prevent deliberate attacks and abuse on the Ethereum network • Still open to DoS attack by infinite loop but attacker should fund the DoS
Complex Smart Contract) - Smart Contract refund (recursive refund) bug (hacks $50M worth of Ether) - Hard Forking to revert hack since it is still in DAO child account - Split of Network to Ethereum (ETH) and Ethereum Classic (ETC) The Parity Multi-Signature Bug - Misuse of parent Smart Contract for Multi-Sig - $31M of Ether stolen (no revert possible) - White hackers hacked $180M before the attacker and returned to owners Still not a bug in Solidity itself, just not that Smart Contracts as name suggests
Actually Oracles listen to Contract events and then execute external request • Centralized Oracles would be a problem for a DApp so Oracles must be distributed • Most correct Oracles are chosen by DApp • Misused Oracles are penalized
Crowdfunding using Cryptocurrencies Current ICOs: Coinmarketcap.com/tokens/ OR Tokenmarket.net/blockchain/all-assets Create your own Digital Asset: Ethereum.org/token Ethereum’s ICO market share > 50% ICOs can result in phishing, Ponzi schemes, and other scams (10% of ICOs)