101

Here's my interpretation, based on the yellow paper: ...the Tries should look more like this:


61

Lets first start with my adaptation of this figure illustrating the Bitcoin block structure: So far so good. All fairly basic. 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....


30

Not especially, but it depends on what the use case is. Block times are subject to the following constraints: If you stamp your block with a time too far in the future, no one else will build on it (miners will not build on a block timestamped "from the future"). Your block time cannot be stamped with an earlier time than its parent. Difficulty is kept ...


26

The blockchain is a list of blocks which are fundamentally lists of transactions. Each transaction has an attached receipt which contains zero or more log entries. Log entries represent the result of events having fired from a smart contract. In the Solidity source code, to define an event, you mark it thus by preceding it with the event keyword (similar in ...


14

Events are dispatched signals the smart contracts can fire. DApps, or anything connected to Ethereum JSON-RPC API, can listen to these events and act accordingly. Event can be indexed, so that the event history is searchable later. An example event from a wallet contract is: event Deposit(address from, uint value); The application (dapp, web application, ...


14

Here is a complete structure of a block and where it plays its role in Ethereum's blockchain. You asked for a diagram but i think this would be more explanatory.


14

First, a basic: using strict equality == block.timestamp would not be safe, since a block with that exact timestamp may never get mined. So use >= block.timestamp Now it depends on what happens when the contract "expiration time" is reached. For reasons similar to the safe use of BLOCKHASH, block.timestamp should only be safely used if the total amount ...


11

In the Ethereum blockchain, the difficulty is used to calculate a target. Here are the ethminer logs for block number 1257006 : ℹ 35:02:42.89 ethminer Solution found; Submitting to http://192.168.4.120:8545 ... ℹ 35:02:42.89 ethminer Nonce: ff4136b6b6a244ec ℹ 35:02:42.89 ethminer Mixhash: ...


10

The block header is the hash returned from generating a Merkle tree that is below the current difficulty target for the blocks data. What's a hash? In order to understand what the block header is you need to understand what a hashing function is. A hashing function is a one way(non invertible function) that maps a set of inputs to a set of outputs hash(s) -...


9

The description can be found in the Yellow Paper which is the formal specification of the Ethereum protocol. Here are the main pieces of a block: 4.3. The Block. The block in Ethereum is the collection of relevant pieces of information (known as the block header), H, together with information corresponding to the comprised transactions, T, and a set ...


8

What you see in block explorers is the sha3 of the block header, not the ethash.


6

Here's a picture from V's article regarding data structures for light clients: https://blog.ethereum.org/2014/02/18/ethereum-scalability-and-decentralization-updates/


5

Block number is not unique you can have two or more blocks with the same number. The chain will eventually sentle on one of them, but for a period of time any of them can be valid, ie some nodes on the network will see one of them to be valid and others nodes can see a different block. Usually the period of time is brief, ie less than five blocks, but in ...


5

Ok, so according to the Yellow paper (section 4.4), we have several fields in the block header: parentHash, 256 bits ommersHash, 256 bits beneficiary, 160 bits stateRoot, 256 bits transactionsRoot, 256 bits receiptsRoot, 256 bits logsBloom, 256 bytes (see here) difficulty, big int scalar number, big int scalar gasLimit, big int scalar gasUsed, big int ...


5

It's the timestamp of the current block. The idea is like this: When a miner mines a block, he/she picks the timestamp, executes all contracts with the chosen timestamp to update the state, and does the searching. Thus, now is the timestamp of the current block.


5

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', gasLimit: 3141592, gasUsed: 0, hash: '0x5d15649e25d8f3e2c0374946078539d200710afc977cdfc6a977bd23f20fa8e8', logsBloom: '...


4

Vitalik Buterin gives a compact answer: Every block header in Ethereum contains 3 trees for three kinds of objects: Transactions, Receipts (essentially, pieces of data showing the effect of each transaction), State. You can read a longer version with pictures here.


4

You can find the block header's structure in the Yellow paper, 4.4 (page 5). I don't have time to go through eveyrthing, but if I do not make any mistake, for example, you could bind the following: cd7bd64fba4cc782fe5474d3640882afece5887180591e72f80ce6916cf73526 --> Parent hash 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 --> ...


3

My company runs a blockchain explorer. Here is the information we have for that linked block. I've had a look through the raw data and none of the nonces actually start with 0x88 (as returned from a JSON RPC call to a Parity (1.6.8) node) It looks as though Etherscan is adding this. I am unsure why. It maybe something to do with how Etherscan have ...


3

I doubt there has ever been an actual case of this happening (don't quote me on that unless you also quote that I said not to quote me on it). In order for a block to be valid by Parity and not valid for Geth, a miner would have to knowingly create a block with a time sufficiently in the future, and this is against their best interest since nodes will ...


3

Here's the image from the linked answer Ethereum block architecture provided in your comment. And here's the data from a block 1932656. Beneficiary in the image above is the miner in the data below. The Beneficiary receives the block reward of 5 ethers. > eth.getBlock("latest") { difficulty: 59542618611819, extraData: "...


3

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', gasLimit: 3141592, gasUsed: 0, hash: '0x5d15649e25d8f3e2c0374946078539d200710afc977cdfc6a977bd23f20fa8e8', logsBloom: '...


2

I don't have ethminer installed, so I can't verify this myself just yet. However, looking at the code I'd venture to guess that ethminer is partially encoding the bytes constituting the block header hash as an ASCII or UTF-8 string (or something along those lines) while geth interprets them as a hexadecimal string. Same data, essentially, but different ...


2

Just brainstorming here but I guess the reason block times are accurate is for the same reason the miners agree on all of the other parameters a block must have. Eg they agree that they pay 3 Eth, at time of writing, for each new block. If a miner tries to award themselves more than the block reward their block is rejected. Similarly if a miner submits a ...


2

No, they cannot. However, it is quite simple to trustlesly verify the extraData from the past 256 blocks: simply provide the full header and make sure the hash matches the block hash


2

The header is defined here, and the 5 scalar values are *big.Int. These are arbitrary precision integers, so variable size.


2

It is a block without transaction https://ropsten.etherscan.io/block/4138624, so those fields are keccak256 of an empty array of bytes. If you look at blocks for other networks like rinkeby or mainnet they will have the same value https://rinkeby.etherscan.io/block/3074567 https://etherscan.io/block/6422766


2

It's not the same function, it has an asterisk and, as per the definition right after the excerpt in the posted image, a function L(x)* is an element-wise sequence transformation:


2

The Block number is not inherently unique. The Block number is the measure of blocks starting from the block in question to the first block(the genesis block). It might be simple to assume that the direction of counting the blocks is an unnecessary clarification but this gains some ambiguity when dealing with hard forks. In the case of a blockchain with ...


2

The only way to do this currently is by passing the history of block headers for validation through hashing to the contract. Obviously this is very expensive. Look at the blockhash refactoring EIPs for a proposed change to the protocol to do this more efficiently.


Only top voted, non community-wiki answers of a minimum length are eligible