12.9 Ethereum and Smart Contracts
223
contract during the submission process. She displays this address and the amount to
pay on the QR-code shown to the customer, who then transfers ether to the contract.
This transaction is included in the next block, at which point the contract runs,
updates the drinks variable, and distributes the received amount into the tax and
the business account. Note that including the contract in the blockchain will cost gas,
which the publican pays, and later running the contract costs gas again, which the
customer, as the initiator of the transaction, pays. Typically the gas required for a
transaction is equivalent to cents of Euro or US$.
The structure of smart contracts with a constructor that runs at submission time
and a number of functions that have access to information about the initiator of
the calling transaction and the global state of the blockchain, is very flexible. It
can be used, for example, to introduce tokens, to serve as a unit of trade. One can
think of the gambling chips purchased at the entrance of a casino and subsequently
used for all gamling in-house. A second example are stocks of a company, which
give the holders a stake in the company an entitles them to a share of the annual
dividends. Even secondary cryptocurrencies on top of the Ethereum blockchain have
been introduced. Libraries facilitate the introduction of new tokens: ERC20 [16] for
exchangeable, fungible, tokens and ERC721 [17] for non-fungible tokens, such as
virtual collectibles that are unique, for example, cryptokitties [18].
At this point it should be obvious that the initiator of a transaction has the role
of a “client,” who interacts with a “server,” whose role is taken by the blockchain
together with the miners. The communication is based on standard network protocols
and well-documented interfaces of the smart contracts. This infrastructure facilitates
the writing of decentralized applications (DApps), where the client software, one
can think of enhanced wallets, sends messages and ether back and forth to the contracts. Add-ons to browsers, command-line interfaces, or standalone applications are
feasible.
Building smart contracts on top of Ethereum is not the only way to utilize
blockchains. Frameworks, such as Hyper-ledger [19], can be used to deploy
blockchains, either private or public, to store information and company-specific rule
sets in smart contracts. Keeping a permanent record of quality-control data in a
database, where they can never be changed but trigger mitigation actions if an item is
faulty, is one application. Going one step further, smart contracts can formalize the
operational rules of a joint venture of mutually non-trusting partners. Crowd-sourcing
funds for a novel project, may serve as an example for a so-called a decentralized
autonomous organization (DAO). Presently such ventures operate outside the jurisdiction of most countries, but that is about to change in the future [20].
The integrity of these organizations relies on the underlying cryptographic methods, which motivates to look into modern developments in physics an computing and
how they can compromise the cryptography. Most cryptographic methods are based
on trap-door functions that are easy to calculate, but extremely difficult to invert.
The classic example is factoring a very large number into its prime factors. The
difficulty depends on the available computing power. Since quantum computers use
completely different algorithms compared to today’s computers, we briefly discuss
their inner workings and how much of a threat they pose to cryptography.
223
contract during the submission process. She displays this address and the amount to
pay on the QR-code shown to the customer, who then transfers ether to the contract.
This transaction is included in the next block, at which point the contract runs,
updates the drinks variable, and distributes the received amount into the tax and
the business account. Note that including the contract in the blockchain will cost gas,
which the publican pays, and later running the contract costs gas again, which the
customer, as the initiator of the transaction, pays. Typically the gas required for a
transaction is equivalent to cents of Euro or US$.
The structure of smart contracts with a constructor that runs at submission time
and a number of functions that have access to information about the initiator of
the calling transaction and the global state of the blockchain, is very flexible. It
can be used, for example, to introduce tokens, to serve as a unit of trade. One can
think of the gambling chips purchased at the entrance of a casino and subsequently
used for all gamling in-house. A second example are stocks of a company, which
give the holders a stake in the company an entitles them to a share of the annual
dividends. Even secondary cryptocurrencies on top of the Ethereum blockchain have
been introduced. Libraries facilitate the introduction of new tokens: ERC20 [16] for
exchangeable, fungible, tokens and ERC721 [17] for non-fungible tokens, such as
virtual collectibles that are unique, for example, cryptokitties [18].
At this point it should be obvious that the initiator of a transaction has the role
of a “client,” who interacts with a “server,” whose role is taken by the blockchain
together with the miners. The communication is based on standard network protocols
and well-documented interfaces of the smart contracts. This infrastructure facilitates
the writing of decentralized applications (DApps), where the client software, one
can think of enhanced wallets, sends messages and ether back and forth to the contracts. Add-ons to browsers, command-line interfaces, or standalone applications are
feasible.
Building smart contracts on top of Ethereum is not the only way to utilize
blockchains. Frameworks, such as Hyper-ledger [19], can be used to deploy
blockchains, either private or public, to store information and company-specific rule
sets in smart contracts. Keeping a permanent record of quality-control data in a
database, where they can never be changed but trigger mitigation actions if an item is
faulty, is one application. Going one step further, smart contracts can formalize the
operational rules of a joint venture of mutually non-trusting partners. Crowd-sourcing
funds for a novel project, may serve as an example for a so-called a decentralized
autonomous organization (DAO). Presently such ventures operate outside the jurisdiction of most countries, but that is about to change in the future [20].
The integrity of these organizations relies on the underlying cryptographic methods, which motivates to look into modern developments in physics an computing and
how they can compromise the cryptography. Most cryptographic methods are based
on trap-door functions that are easy to calculate, but extremely difficult to invert.
The classic example is factoring a very large number into its prime factors. The
difficulty depends on the available computing power. Since quantum computers use
completely different algorithms compared to today’s computers, we briefly discuss
their inner workings and how much of a threat they pose to cryptography.
