From e8b672e68b4d61f7658d1ff884402ca32609081c Mon Sep 17 00:00:00 2001 From: Steve Goodman <39279277+stoobie@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:49:36 +0200 Subject: [PATCH] docs: Clarify that `event_commitment` and `transaction_commitment` have separate trees. (#902) * Clarify that `event_commitment` and `transaction_commitment` have separate trees. * Update components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc * Update components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc * Update components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc * Fixed some stem formatting. * Update components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc * Minor edits * Update components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc --- .../pages/Network_Architecture/header.adoc | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc b/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc index faad456bff..06325cd4d4 100644 --- a/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc +++ b/components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/header.adoc @@ -3,7 +3,7 @@ [id="block_structure"] = Block structure -In Starknet, the block is defined as a list of transactions and a block header containing the following fields: +In Starknet, a block is a list of transactions, and a block header that contains the following fields: [%autowidth] @@ -23,24 +23,24 @@ In Starknet, the block is defined as a list of transactions and a block header c | `extra data` | `FieldElement` | Extraneous data that might be useful for running transactions | |=== -[NOTE] -==== -The commitment fields `event_commitment` and `transaction_commitment` are the roots of a height 64 binary Merkle Patricia tree. +Where: -For `event_commitment`, the leaf at index stem:[$i$] corresponds to the hash of the stem:[$i'th$] event. -For `transaction_commitment`, the leaf at index stem:[$i$] corresponds to stem:[$h(transaction \ hash, signature)$] if the stem:[$i'th$] transaction is an `invoke` transaction and stem:[$h(0,0)$] otherwise. +[horizontal,labelwidth='30'] +`event_commitment`:: is the root of a 64-bit high binary Merkle Patricia tree. The leaf at index stem:[$i$] corresponds to the hash of the stem:[$i'th$] event. +`transaction_commitment`:: is the root of a 64-bit high binary Merkle Patricia tree. The leaf at index stem:[$i$] corresponds to stem:[$${h(transaction \space hash, signature)}$$] if the stem:[$i'th$] transaction is an `invoke` transaction and stem:[$h(0,0)$] otherwise. -==== -[id="block_hash"] + + +[#block_hash] == Block hash -The block hash is defined as the Pedersen hash over the header's elements. +A block hash is defined as the Pedersen hash of the header's fields, as follows: -[source,cairo] +[,,subs="quotes"] ---- -ℎ(𝐵) = ℎ( +_h_(𝐵) = _h_( block_number, global_state_root, sequencer_address, @@ -55,9 +55,9 @@ The block hash is defined as the Pedersen hash over the header's elements. ) ---- -Where stem:[$h$] is the xref:../../Cryptography/hash-functions.adoc#pedersen-hash[Pedersen] hash. +Where `_h_` is the xref:../../Cryptography/hash-functions.adoc#pedersen-hash[Pedersen hash]. [NOTE] ==== Zeros inside the hash computation of an object are used as placeholders, to be replaced in the future by meaningful fields. -==== \ No newline at end of file +====