Skip to main content
35 votes
Accepted

What is an Event?

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 ...
Thomas Jay Rush's user avatar
25 votes

Ethereum block architecture

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.
Vishal Sharma's user avatar
19 votes

What is an Event?

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 ...
Mikko Ohtamaa's user avatar
10 votes

Ethereum block architecture

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 ...
Jouko Salonen's user avatar
10 votes
Accepted

Block header structure change under the Merge to Proof of Stake?

Your question is a bit tricky because it depends on which types of block you speak of. After the merge, the beacon blocks will encapsulate all the info and thus can be considered as "the main ...
upavloff's user avatar
  • 1,210
9 votes

Why are there no leading zeroes in ethereum block hash?

What you see in block explorers is the sha3 of the block header, not the ethash.
Yaron Welner's user avatar
9 votes

How large are the Ethereum block headers?

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, ...
Randomblue's user avatar
  • 2,620
9 votes

Block header hash calculation

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', ...
AnuragP's user avatar
  • 451
8 votes

block-header hash verification

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', ...
AnuragP's user avatar
  • 451
6 votes

Is a block number unique or does it change if the block becomes uncle? Does the transaction hash include a block hash as input?

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 ...
Ismael's user avatar
  • 30.3k
6 votes

Ethereum block architecture

Extrapolating from the syntactic block structure, we can also ask what the semantic ethereum world state structure looks like. I use this diagram to explain the relationship between "on-chain&...
samlaf's user avatar
  • 160
4 votes

Block header format

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: ...
Itération 122442's user avatar
3 votes

Is a block number unique or does it change if the block becomes uncle? Does the transaction hash include a block hash as input?

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 ...
Vignesh Karthikeyan's user avatar
3 votes

block hash from block-header rlp

Below are the steps to calculate blockHash, given a blockNumber: Step1. eth.getBlock(400000) Output:{ difficulty: '6022643743806', extraData: '0xd583010202844765746885676f312e35856c696e7578', ...
AnuragP's user avatar
  • 451
3 votes

How Geth and Parity resolve timestamps when validating block headers?

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 ...
natewelch_'s user avatar
  • 12.2k
3 votes

What is an Event?

The yellowpaper (version 7e819ec - 2019-10-20) section 6.1 Substate includes a description of: indexable ‘checkpoints’ in VM code execution that allow for contract-calls to be easily tracked ...
eth's user avatar
  • 86.5k
3 votes

How is the nonce in a the block header arrived at?

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 ...
Thomas Clowes's user avatar
3 votes
Accepted

Can contracts access the block header extraData field?

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
Tjaden Hess's user avatar
  • 37.3k
3 votes
Accepted

How are Ethereum 2 block hashes computed?

According to EIP-3675, with the transition to Proof of Stake: Each block field listed in the table below MUST be replaced with the corresponding constant value Field Constant value Comment ...
eth's user avatar
  • 86.5k
2 votes

How large are header scalar values?

The header is defined here, and the 5 scalar values are *big.Int. These are arbitrary precision integers, so variable size.
Randomblue's user avatar
  • 2,620
2 votes

How Geth and Parity resolve timestamps when validating block headers?

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 ...
willjgriff's user avatar
  • 1,658
2 votes
Accepted

Strange Ropsten Bug - transactionsRoot and recieptsRoot has same value

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 ...
Ismael's user avatar
  • 30.3k
2 votes
Accepted

Why is LH repeated in equation 35 of the yellow paper?

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:
Paul Razvan Berg's user avatar
2 votes
Accepted

Addresses in paths of State Patricia Trie

Every block header has 3 patricia trees. It contains a hash of the root nodes of 3 tries, not the entire tries. The tries themselves aren't stored in the block, they're stored separately in the state ...
Richard Horrocks's user avatar
2 votes

block-header hash verification

This is almost correct, but just a couple of details to make it work: After London fork, a new field in the header must be taken into account: baseFeePerGas. This should be the last field in the ...
jfc's user avatar
  • 21
2 votes
Accepted

Verify a block exists

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 ...
natewelch_'s user avatar
  • 12.2k
2 votes
Accepted

Compute transactions trie root hash from a BlockBodies message using ethereumjs

After reviewing how ethereumjs-block:Block.genTxTrie() does it, I managed to figure it out: const trie = new Trie() await Promise.all(transactionsRaw.map((t, i) => new Promise(resolve => { ...
todofixthis's user avatar
2 votes

The current provider doesn't support subscriptions: HDWalletProvider on Polygon (matic) blockchain

There is an issue in HDWalletProvider in which you can attach a ws provider but it does not believe it allows event subscriptions. See 1. Thanks to mikec on that issue page, the following workaround ...
K. Lane's user avatar
  • 51
2 votes
Accepted

How Uncles (Ommers) Hash include in headers?

I think the yellow paper or beige paper best explain this. to understand uncles first it's important to understand consensus. imagine two miners, let's say in US and in China, work on two different ...
high_byte's user avatar
  • 313
1 vote

can only change header's extra data to mine a new block?

You can change any data to try to find a mine a valid block. You could change the order of the transactions if you want. The reason miners don't do that is because it would be terribly inefficient. It ...
natewelch_'s user avatar
  • 12.2k

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