Skip to content

Commit 82b3cfe

Browse files
committed
Add changed block hashing scheme.
1 parent bf80973 commit 82b3cfe

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

updates/P7.txt

+76
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The protocol change has the following main effects
2020
they already have stake in cooldown;
2121
- disallows shielded (or encrypted) transfer transactions (`TransferToEncrypted`,
2222
`EncryptedAmountTransfer` and `EncryptedAmountTransferWithMemo`).
23+
- redefines the block hashing scheme to better support light clients.
2324

2425
Background
2526

@@ -110,6 +111,12 @@ supported shielded transfers (also known as encrypted transfers).
110111
This mechanism allows an account to "shield" part of its balance,
111112
cryptographically encrypting it so that the amount cannot be inspected
112113
except by the owner of the account (using its secret encryption key).
114+
(It is possible for a sufficient combination of identity disclosure
115+
authorities (e.g. 2 of 3) to act in concert with the identity provider
116+
for an account to recover the secret encryption key (for instance, if
117+
compelled to do so by legal authorities) and thus decrypt the shielded
118+
balance and transfers on that account.)
119+
113120
An account can transfer an amount from its shielded balance to another
114121
account. While the sender and receiver are publicly visible, the exact
115122
amount transferred (in CCD) is not. An account can also decrypt funds from
@@ -130,6 +137,25 @@ funds from an account's shielded funds to its own unshielded funds)
130137
remains enabled. This ensures that accounts do not lose any funds that
131138
they previously shielded.
132139

140+
* * *
141+
142+
A block hash is a cryptographic hash of the contents of a block, and serves
143+
as a unique identifier for the block. The block hash is not only derived from
144+
the header fields of a block, but also the state of the chain after executing
145+
the block, including the current state of each account and smart contract.
146+
The block hashing scheme determines how the block hash is derived from this
147+
data. In particular, individual elements are hashed and their hashes are
148+
combined and hashed again into a Merkle tree structure. This structure makes
149+
it possible to prove that a block (whose hash is known to the verifier)
150+
contains some specific data (such as the balance of a particular
151+
account) without providing the entirety of the data comprising the block.
152+
153+
In protocol version 7, the block hashing scheme is redefined. The revised
154+
definition makes certain Merkle proofs shorter and simpler. The purpose of
155+
this is to support "light clients": light-weight verifiers that can check
156+
properties of the chain without running the full consensus, by making use of
157+
Merkle proofs.
158+
133159
Changes
134160

135161
The following behaviors are changed in protocol version 7.
@@ -295,6 +321,56 @@ The following behaviors are changed in protocol version 7.
295321
considered invalid. Transactions of these types will be rejected with
296322
a `SerializationFailure` result.
297323

324+
6. The block hashing for a (non-genesis) block in protocol version 7 follows
325+
the structure below:
326+
327+
[BlockHash]
328+
|- protocol version
329+
|- [...]
330+
|- [BlockHeaderHash]
331+
| |- round
332+
| |- epoch
333+
| |- [parent BlockHash]
334+
|
335+
|- [BlockQuasiHash]
336+
|- [metaHash]
337+
| |- [bakerInfoHash]
338+
| | |- [timestampBakerHash]
339+
| | | |- timestamp
340+
| | | |- baker ID
341+
| | |
342+
| | |- [nonceHash]
343+
| | |- block nonce
344+
| |
345+
| |- [certificatesHash]
346+
| |- [QuorumCertificate hash]
347+
| | |- [parent BlockHash]
348+
| | |- QC round
349+
| | |- QC epoch
350+
| | |- aggregate signature
351+
| | |- signatories
352+
| |
353+
| |- [timeoutFinalizationHash]
354+
| |- [Option TimeoutCertificate hash]
355+
| |- [Option FinalizationEntry hash]
356+
|
357+
|- [dataHash]
358+
|- [transactions hash]
359+
|- [BlockResultHash]
360+
|- [...]
361+
| |- [BlockStateHash]
362+
| |- [TransactionOutcomesHash]
363+
|
364+
|- [...]
365+
|- [block height info hash]
366+
| |- absolute block height
367+
| |- genesis index
368+
| |- relative block height
369+
|
370+
|- [...]
371+
|- [current FinalizationCommitteeHash]
372+
|- [next FinalizationCommitteeHash]
373+
298374
Effects
299375

300376
1. At the protocol update, the following changes apply to validator and

0 commit comments

Comments
 (0)