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 ...
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.
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 ...
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 ...
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 ...
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.
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, ...
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', ...
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', ...
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 ...
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&...
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:
...
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 ...
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', ...
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 ...
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♦
- 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 ...
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
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♦
- 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.
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 ...
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 ...
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:
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 ...
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 ...
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 ...
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 => {
...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
block-header × 44blocks × 13
blockchain × 9
hash × 8
yellow-paper × 6
go-ethereum × 5
mining × 4
timestamp × 4
hash-algorithm × 4
rlp × 4
solidity × 3
merkle-patricia-tries × 3
uncle-blocks × 3
ethash × 3
the-merge × 3
events × 2
addresses × 2
proof-of-stake × 2
logs × 2
light-clients × 2
nonce × 2
openethereum × 2
validators × 2
web3js × 1
contract-development × 1