CryptoCoinsInfoClub.com

Ethereum Block Header Structure

Merkling In Ethereum

Merkling In Ethereum

Merkle trees are a fundamental part of what makes blockchains tick. Although it is definitely theoretically possible to make a blockchain without Merkle trees, simply by creating giant block headers that directly contain every transaction, doing so poses large scalability challenges that arguably puts the ability to trustlessly use blockchains out of the reach of all but the most powerful computers in the long term. Thanks to Merkle trees, it is possible to build Ethereum nodes that run on all computers and laptops large and small, smart phones, and even internet of things devices such as those that will be produced by Slock.it . So how exactly do these Merkle trees work, and what value do they provide, both now and in the future? First, the basics. A Merkle tree, in the most general sense, is a way of hashing a large number of chunks of data together which relies on splitting the chunks into buckets, where each bucket contains only a few chunks, then taking the hash of each bucket and repeating the same process, continuing to do so until the total number of hashes remaining becomes only one: the root hash. The most common and simple form of Merkle tree is the binary Mekle tree, where a bucket always consists of two adjacent chunks or hashes; it can be depicted as follows: So what is the benefit of this strange kind of hashing algorithm? Why not just concatenate all the chunks together into a single big chunk and use a regular hashing algorithm on that? The answer is that it allows for a neat mechanism known as Merkle proofs: A Merkle proof consists of a chunk, the root hash of the tree, and the branch consisting of all of the hashes going up along the path from the chunk to the root. Someone reading the proof can verify that the hashing, at least for that branch, is c Continue reading >>

Blockchain Tests Ethereum Homestead 0.1 Documentation

Blockchain Tests Ethereum Homestead 0.1 Documentation

The 160-bit address to which all fees collected from the successful mining of this block betransferred, as returned by the COINBASE instruction. A scalar value corresponding to the difficulty level of this block. This can be alculatedfrom the previous blocks difficulty level and the timestamp, as returned by the DIFFICULTY instruction. A scalar value equal to the current limit of gas expenditure per block, as returned by the GASLIMIT instruction. A scalar value equal to the number of ancestor blocks. The genesis block has a number of zero. A scalar value equal to the reasonable output of Unixs time() at this blocks inception, as returned by the TIMESTAMP instruction. The Keccak 256-bit hash of the parent blocks header, in its entirety The Bloom filter composed from indexable information (logger address and log topics)contained in each log entry from the receipt of each transaction in the transactions list. An arbitrary byte array containing data relevant to this block. This must be 1024 bytes or fewer. A scalar value equal to the total gas used in transactions in this block. A 256-bit hash which proves that a sufficient amount of computation has been carried out on this block. The Keccak 256-bit hash of the root node of the trie structure populated with the receipts of each transaction in the transactions list portion of the block. The Keccak 256-bit hash of the root node of the state trie, after all transactions are executed and finalisations applied. The Keccak 256-bit hash of the root node of the trie structure populated with each transaction in the transactions list portion of the block. The Keccak 256-bit hash of the uncles list portion of this block pre section: as described in State Tests. postState section: as described in State Tests (section - post). blocks s Continue reading >>

Blockchain: What Is In A Block?

Blockchain: What Is In A Block?

In my previous article, I tried to described the concept of a blockchain with code. This time, I'll try to describe the structure of a single block. I will use the Bitcoin blockchain to explain blocks, but keep in mind that the concepts will remain more or less the same. It could be useful to read my last article to understand a few things first. A block is a container data structure. In the Bitcoin world, a block contains more than 500 transactions on average. The average size of a block seems to be 1MB ( source ). In Bitcoin Cash ( a hard fork from the Bitcoin blockchain ), the size of a block can go up to 8MB. This enables more transactions to be processed per second. Anyway, a block is composed of a header and a long list of transactions. Let's start with the header. The header contains metadata about a block. There are three different sets of metadata: The previous block hash. Remember that in a blockchain, every block is inherits from the previous block because we use the previous block's hash to create the new block's hash. For every block N, we feed it the hash of the block N-1. Mining competition. For a block to be part of the blockchain, it needs to be given a valid hash. This contains the timestamp, the nonce and the difficulty. Mining is another crucial part of the blockchain technology, but it is outside the scope of this article. The third part is a merkle tree root. This is a data structure to summarize the transactions in the block. And we will leave it at that for now. More on this later. To identify a block, you have a cryptographic hash, a digital signature if you will. This is created by hashing the block header twice with the SHA256 algorithm. For example, this is a block . I will refer to this block as an example for this article. The block header Continue reading >>

Ethereum Chain Spec Format

Ethereum Chain Spec Format

This is a format to describe any Ethereum-like chain. It is derived from the genesis.json format but includes parameters to change and configure the consensus algorithm, to specify infrastructure information, to specify boot nodes and to specify any built-in contracts together with their cost. It is JSON, with the top level being an object with six keys: name: A string value specifying the chain name. e.g. "Frontier/Homestead", "Morden", "Olympic". forkName: An optional string value specifying a sub-identifier, in case two different chains have equivalent genesis blocks. engine: A enum value specifying the consensus engine. e.g. "Ethash", "Null". params: An object specifying various attributes of the consensus engine, allowing configuration. genesis: An object specifying the header of the genesis block. nodes: An array of strings, each one a node address in enode format. accounts: An object specifying accounts of the genesis block. This includes builtin contracts and premines. There are two valid engines, Ethash and Null. minimumDifficulty: Integer specifying the minimum difficulty a block may have. gasLimitBoundDivisor: Integer specifying the according value in the Yellow Paper. difficultyBoundDivisor: Integer specifying the according value in the Yellow Paper. durationLimit: Integer specifying the boundary point at which difficulty is increased. blockReward: Integer specifying the reward given for authoring a block. registrar: 0x-prefixed, 40-nibble datum of the address of the registrar contract on this chain. Different consensus engines may allow different keys in the params object, however there exist a few common to all: accountStartNonce: Integer specifying what nonce all newly created accounts should have. frontierCompatibilityModeLimit: Integer specifying the n Continue reading >>

A Gentle Introduction To Ethereum

A Gentle Introduction To Ethereum

Ethereum builds on blockchain and cryptocurrency concepts, so if you are not familiar with these, its worth reading a gentle introduction to bitcoin and a gentle introduction to blockchain technology first. This article assumes the reader has a basic familiarity with how Bitcoin works. Ethereum is software running on a network of computers that ensures that data and small computer programs called smart contracts are replicated and processed on all the computers on the network, without a central coordinator. The vision is to create an unstoppable censorship-resistant self-sustaining decentralised world computer. The officialwebsite is Itextends the blockchain concepts from Bitcoin which validates, stores, and replicates transaction data on many computers around the world (hence the term distributed ledger). Ethereum takes this one step further, and also runs computer code equivalently on many computers around the world. What Bitcoin does for distributed data storage, Ethereum does for distributed data storage plus computations. The small computer programsbeing run are called smart contracts, and the contractsare run by participants on their machines using asort ofoperating system called a Ethereum Virtual Machine. To run Ethereum, you can download (or write yourself if you have the patience) some software called an Ethereum client. Just like BitTorrent or Bitcoin, the Ethereum client will connect over the internet to other peoples computers running similar client softwareand start downloading the Ethereum blockchain from them to catch up. It will also independently validate that each block conforms to the Ethereum rules. What does the Ethereum client software do? You can use itto: Create new transactions and smart contracts Your computer becomes a node on the network, r Continue reading >>

Uncle Mining, An Ethereum Consensus Protocolflaw

Uncle Mining, An Ethereum Consensus Protocolflaw

Uncle Mining, an Ethereum Consensus ProtocolFlaw A year ago I was hired by Eth Dev Ltd through Coinspect to perform a security audit on the Ethereum design. One of our findings was that the uncle reward strategy in Ethereum was weird, and could lead to miners abusing the uncle rewards to almost triple the money supply. We discovered this problem because I had been working on the same problem for a long time, and posting in cryptocurrency mailing lists and in this blog about a variation of Nakamoto consensus protocol called DECOR+ , that is based on sharing block rewards between competing blocks. At that time I explained the flaw and suggested to limit the number of uncles to prevent an unbounded money supply function. I assumed the Ethereum core team would pick the DECOR+ protocol sooner or later, but Ethereum has now gone through several programmed hard-forks, and the problem still remains. Last week, and the night before a presentation of the RSK (a.k. Rootstock) smart-contract platform, I decided to explore the problem a little more, and I found to my surprise that the uncle mining strategy theoretically works in Ethereum at very low thresholds, and therefore the current Ethereum consensus protocol is certainly not incentive compatible. Uncle mining strategy consist of forcing you own blocks into uncles (blocks not in the best chain) in order to earn uncle rewards while preventing your blocks from contributing to the block difficulty adjustments. Uncle mining is a greedy strategy (or even it can be considered dishonest), as the greedy miners get monetary compensations while providing less of the expected service to the network: uncle mining does contribute to securing the network due to GHOST weighting, but does not contribute to increasing the network transaction p Continue reading >>

Ethereum Archives | Nxter.org

Ethereum Archives | Nxter.org

Ardor vs. the Competition, Pt. 8: Ethereum (Blockchain Bloat) Or you can download the complete series as a free ebook here: Ardor vs The Competition This series started with a brief, informal reddit post with my initial reactions to the Plasma paper. I didnt know at the time that it would launch me on a tour of half a dozen other cryptocurrency projects, ranging from sidechain platforms (Lisk, Stratis, arguably Komodo) to colored-coins platforms with unique features (NEM, Waves), to a project that eschews the blockchain altogether in favor of a completely different data structure (IOTA). Now that we have come full-circle, with the last two articles focusing once again on Ethereum, I think we have reached a good place to conclude. This series has covered a lot of ground, and I wont attempt to summarize everything here. Instead, I would like to share my thoughts on an overarching theme that emerged from my research on these projects. As Ive mentioned before, my primary interest throughout this series has been to survey various approaches to the difficult problem of scaling a blockchain. What Ive learned is that there are many different strategies, but most involve a trade-off with security. I am certainly not the first one to make this observation, but I think it bears repeating here in the context of this series. At one end of the spectrum, the most secure way to launch a new blockchain project is probably to issue a token on an existing blockchain that has already secured itself. This is the colored-coins approach that Nxt, NEM, Waves, and Ethereum use, for example. Transactions involving these tokens are recorded directly on the underlying blockchain and are therefore just as secure as any other transactions on it. The obvious drawback of this approach is that it does Continue reading >>

Design Rationale Ethereum/wiki Wiki Github

Design Rationale Ethereum/wiki Wiki Github

(Image from ) Ethereum jettisons this scheme in favor of a simpler approach: the state stores a list of accounts where each account has a balance, as well as Ethereum-specific data (code and internal storage), and a transaction is valid if the sending account has enough balance to pay for it, in which case the sending account is debited and the receiving account is credited with the value. If the receiving account has code, the code runs, and internal storage may also be changed, or the code may even create additional messages to other accounts which lead to further debits and credits. Higher degree of privacy: if a user uses a new address for each transaction that they receive then it will often be difficult to link accounts to each other. This applies greatly to currency, but less to arbitrary dapps, as arbitrary dapps often necessarily involve keeping track of complex bundled state of users and there may not exist such an easy user state partitioning scheme as in currency. Potential scalability paradigms: UTXOs are more theoretically compatible with certain kinds of scalability paradigms, as we can rely on only the owner of some coins maintaining a Merkle proof of ownership, and even if everyone including the owner decides to forget that data then only the owner is harmed. In an account paradigm, everyone losing the portion of a Merkle tree corresponding to an account would make it impossible to process messages that affect that account at all in any way, including sending to it. However, non-UTXO-dependent scalability paradigms do exist. Large space savings: for example, if an account has 5 UTXO, then switching from a UTXO model to an account model would reduce the space requirements from (20 + 32 + 8) * 5 = 300 bytes (20 for the address, 32 for the txid and 8 for Continue reading >>

What Is A Block Header In Bitcoin?

What Is A Block Header In Bitcoin?

The main way of identifying a block in the blockchain is via its block header hash. The block header hash is calculated by running the block header through the SHA256 algorithm twice . A block header hash is not sent through the network but instead is calculated by each node as part of the verification process of each block. The block header data is shown in the table below: The Bitcoin version number is used to keep track of upgrades and changes in the protocol. The previous block header hash is the linkage into the previous block and secures the chain. The timestamp is the number of seconds since the first of January 1970 and the difficulty target of the block is the number of zeroes that must be found when hashing the block header in order to meet the required level of proof of work to maintain the block time at 10 minutes. The nonce is the value that is altered by the miners to try different permutations to achieve the difficulty level required the nonce has been appended by the extra nonce function which sits in the coinbase transaction or the first transaction of the Merkle root signifying who to pay the block reward to an extra counter to add permutations to as the nonce number can be used well within a second by modern mining equipment. Continue reading >>

Go-ethereum/block.go At Master Ethereum/go-ethereum Github

Go-ethereum/block.go At Master Ethereum/go-ethereum Github

// The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see Continue reading >>

From Bitcoin To Ethereum

From Bitcoin To Ethereum

In response to: Cryptocurrencies and Blockchains (Vol. 2, No. 4). Jean-Paul Delahaye explains clearly in his article how the bitcoin protocol works, as well as the enthusiasm and fear it elicits. The major innovation behind bitcoin is the creation of an ecosystem that allows for a decentralized consensus. Users no longer need a reliable central authority to interact with each other. While it is difficult to predict how blockchain technology will become important in our everyday activities over the next few yearsincreasing our happiness, or notthe enthusiasm it elicits is growing. It could have many applications, of which cryptocurrencies are only an initial example. Among the platforms arousing great interest is Ethereum, which allows users to manage and interact with smart-contracts. Ethereum promises applications that work exactly as they were programmed and cannot be interrupted, censored, or modified in any way. It has been spoken of as one of the building blocks of web 3.0! Understanding precisely how all this works in practice is a fascinating subject. How can a user, interacting with the network via only his smartphone, quickly verify that a transaction has been saved on the blockchain? One approach uses the concept of a Merkle tree. This is an important data structure used in computing and cryptography, and I would like to follow up Delahayes article by explaining this point. Another legitimate question that one might ask with reference to the mechanism of transaction validation is: why do bitcoins have real economic value? There is more to bitcoin than simply a currency of exchange. To illustrate this, I will examine in some detail a transaction inscribed in the bitcoin blockchain. This has nothing to do with any financial transaction, on the contrary, it is c Continue reading >>

How Does Ethereum Work, Anyway?

How Does Ethereum Work, Anyway?

Odds are youve heard about the Ethereum blockchain, whether or not you know what it is. Its been in the news a lot lately, including the cover of some major magazines, but reading those articles can be like gibberish if you dont have a foundation for what exactly Ethereum is. So what is it? In essence, a public database that keeps a permanent record of digital transactions. Importantly, this database doesnt require any central authority to maintain and secure it. Instead it operates as a trustless transactional system a framework in which individuals can make peer-to-peer transactions without needing to trust a third party OR one another. Still confused? Thats where this post comes in. My aim is to explain how Ethereum functions at a technical level, without complex math or scary-looking formulas. Even if youre not a programmer, I hope youll walk away with at least better grasp of the tech. If some parts are too technical and difficult to grok, thats totally fine! Theres really no need to understand every little detail. I recommend just focusing on understanding things at a broad level. Many of the topics covered in this post are a breakdown of the concepts discussed in the yellow paper. Ive added my own explanations and diagrams to make understanding Ethereum easier. Those brave enough to take on the technical challenge can also read the Ethereum yellow paper. A blockchain is a cryptographically secure transactional singleton machine with shared-state.[1]Thats a mouthful, isnt it? Lets break it down. * Cryptographically securemeans that the creation of digital currency is secured by complex mathematical algorithms that are obscenely hard to break. Think of a firewall of sorts. They make it nearly impossible to cheat the system (e.g. create fake transactions, erase tra Continue reading >>

Ethereum Wallet Syncing Problems

Ethereum Wallet Syncing Problems

One of the most common problems with the Ethereum Wallet application is keeping the blockchain in sync with the Ethereum network. This page describes some of the common issues users may encounter while trying to sync the blockchain and potential methods to work around the problems. Note that Ethereum Wallet will not display your account balance correctly when it is not synced fully or correctly. Check that your the clock on your computer is close to real time. Change your system settings so that your system clock is synced to an NTP (Network Time Protocol) server. Slow Syncing Between Blocks 2,283,397 And 2,717,576 You may be encountering some problems syncing Ethereum Wallet (or Mist) to the Mainnet blockchain. A common problem when syncing Ethereum Wallet's blockchain data is that the syncing slows down between blocks 2,283,397 and 2,620,384 due to the attack on the Ethereum network (reference Why is my node synchronization stuck/extremely slow at block 2,306,843? ). The syncing also slows down between blocks 2,675,055 and 2,717,576 due to the state clearing process to remove the 20 million empty accounts created by the network attack. If you have a problem with slow syncing, the easiest way to recover from this slowdown is to remove your blockchain data and restart Ethereum Wallet. Ethereum Wallet will then perform a fast sync which skips over these attack blocks. WARNING: Make sure you back up your keystore directory so you don't accidentally delete your account information. Depending on your operating system, you will find the chaindata subdirectory in: Alternatively, you can run geth removedb to remove the blockchain data. Start Ethereum Wallet. It should now start fast syncing the blockchain data. Alternatively, run geth --syncmode "fast" --cache 1024 console an Continue reading >>

Blockchain - Ethereum Block Architecture - Ethereum Stack Exchange

Blockchain - Ethereum Block Architecture - Ethereum Stack Exchange

Where can I find a description (preferably a diagram like below) showing the block structure in an Ethereum blockchain? Lets first start with my adaptation adaptation of this figure illustrating the Bitcoin block structure: Enter Ethereum and things get a wee bit more complex. After reading through this and this , and as per @ eth 's recommendation this , my best interpretation is the figure below: The header field definitions are available in section 4.3 of the yellow paper . Uncles is a hash (of a list of uncles), Yellow Paper has: "The Keccak 256-bit hash of the ommers list portion of this block". Codehash is just a hash since contracts are immutable. The pointers point to "hash of whole block header" (the Keccak-256 hash of all the bytes in the block header). To have a full diagram, should really consult the Yellow Paper... eth Jan 29 '16 at 22:53 Updated response after consulting the YP. Starting to get clearer now. Thanks! zanzu Feb 1 '16 at 12:34 Why are the transactions from block N linked to those of block N+1? Sebi Jun 10 '16 at 8:31 These links correspond to contract state that has not changed in between blocks. Referencing the state from the previous blocks instead of replicating is more efficient from a block size perspective. zanzu Jun 10 '16 at 9:49 Continue reading >>

Blockchain Developer Api For Ethereum | Blockcypher

Blockchain Developer Api For Ethereum | Blockcypher

# ^# / \ _ _# / ^ \ |_) | _ _ | / ._ |_ _ ._#< > |_) | (_) (_ |< \_ \/ |_) | | (/_ |# \ v / / |# \ /# v Welcome to BlockCyphers Ethereum API documentation! If youre familiar with our Bitcoin endpoints, youll feel right at home with our Ethereum API. However, there are a few differences, and they stem in part from the fundamental differences between Bitcoin and Ethereum. In the most abstract sense, Bitcoin and Ethereum are cousins; they both have blocks of transactions linked together into a chain, they both use Proof of Work to reach consensus (for now, as Ethereum plans to move to Proof of Stake in a future release), they are both about decentralizing trust. But thats where the similarities end. Here are just some of Ethereums differences: There are no UTXOs, only accounts (of two varieties) Block time is significantly shorter; 15 second target instead of 10 minutes Miners get rewards for including references to orphan blocks (so called uncle blocks) Ethereums scripting language is far more expressive than Bitcoins; typically advanced transactions/contracts are constructed using a higher level language then converted into EVM bytecode Ethereum has no strict cap on monetary supply (ether supply) Transactions cost gas to run (denominated in ether) depending on how computationally expensive they are to run. Blocks also have total gas limits to prevent runaway computation/keep the network decentralized. In a nutshell, Bitcoin is about decentralized, trust-minimizing, sound money. Ethereum is about decentralized, trust-minimizing, sound computation. Much more detail about these differences can be read at the Ethereum Wiki here. You can find more information at the projects webpage as well. man curl | grep -A 3 "DESCRIPTION"DESCRIPTIONcurl is a tool to transfer data from or Continue reading >>

More in ethereum