Java Magazine, Jan/Feb 2017
Block 0 Block 1 Block m ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2017 37 cryptocurrency all DLTs use a common blockchain behind the scenes as in Ethereum some keep data private between those parties entering into a transaction In Ethereum data is written to and subsequent state transitions take place within the Ethereum Virtual Machine EVM which like the Java Virtual Machine interprets a bytecode format to execute the instructions in a transaction But unlike the JVM it uses a network of fully decentralized nodes Each node executes these instructions locally verifying that its local version of the blockchain matches those that have been written to the Ethereum blockchain previously For the addition of a new block containing new transactions to be successful certain nodes must reach a consensus with a majority of nodes on the network regarding what the new state should be The nodes that create these new blocks are called miners Mining The mining nodes use a consensus mechanism called proof of work which incidentally is the same style of consensus mechanism Bitcoin uses It relies on raw computing power to create new blocks on the blockchain Blocks are created by continually hashing groups of new transactions that havent been assigned to a block yet When a combination of transactions is found that solves a predefined computational problem referred to as difficulty the miner that found the solution is rewarded by the network with newly minted currency and that block is then added to the blockchain Smart Contracts The programs that execute in the EVM are referred to as smart contracts A smart contract is a computerized contract In Ethereum smart contracts are a collection of code functions and data state associated with an address in the Ethereum blockchain Getting Started with Ethereum To start working with the Ethereum network you need to have access to an Ethereum client also called a node or peer The Ethereum clients synchronize the Ethereum blockchain with one another and they provide a gateway to interacting with the blockchain The two most widely used and complete Ethereum clients available are Geth and Parity Simply download one of the clients and then start it up geth rpcapi personal db eth net web3 rpc testnet parity chain testnet This will start the client and it will commence syncing the testnet Ethereum blockchain which is multiple gigabytes in size There are two public versions of the Ethereum network mainnet and testnet also known as Ropsten reflecting the live and test environments respectively You are going to work with testnet in this article otherwise youll need to start spending real money You will also need the latest available version of the Transaction 1 Transaction n 1 Transaction n 2 Transaction n 3 Transaction 2n Transaction m n 1 Transaction m n 2 Transaction m n 3 Transaction m n n Transaction 2 Transaction 3 Transaction n Figure 1 The structure of a blockchain
You must have JavaScript enabled to view digital editions.