From cc5b418497e757c7f309ba35e74950cffa714d6f Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:47:17 +0530 Subject: [PATCH] Moving the Burn information into the Action Group (#97) This shifts the information pertaining to the burning of assets into the OrchardZSA Action Group -- this occurs both in the Transaction Format and the computation of the TxID digest. --- rendered/zip-0226.html | 44 ++++++++++++++++++------------------------ rendered/zip-0230.html | 26 ++++++++++++------------- zips/zip-0226.rst | 32 +++++++++++------------------- zips/zip-0230.rst | 12 ++++++------ 4 files changed, 49 insertions(+), 65 deletions(-) diff --git a/rendered/zip-0226.html b/rendered/zip-0226.html index 5a48dc80b..df0e652d3 100644 --- a/rendered/zip-0226.html +++ b/rendered/zip-0226.html @@ -474,7 +474,6 @@
When OrchardZSA Actions Groups are present in the transaction, this digest is a BLAKE2b-256 hash of the following values:
T.4a: orchard_action_groups_digest (32-byte hash output) [ADDED FOR ZSA] -T.4b: orchard_zsa_burn_digest (32-byte hash output) [ADDED FOR ZSA] T.4c: valueBalanceOrchard (64-bit signed little-endian)
The personalization field of this hash is the same as in ZIP 244 15
"ZTxIdOrchardHash"@@ -482,12 +481,13 @@
BLAKE2b-256("ZTxIdOrchardHash", [])
A BLAKE2b-256 hash of the subset of OrchardZSA Action Groups information for all OrchardZSA Action Groups belonging to the transaction. For each Action Group, the following elements are included in the hash:
-T.4a.i : orchard_actions_compact_digest (32-byte hash output) -T.4a.ii : orchard_actions_memos_digest (32-byte hash output) -T.4a.iii: orchard_actions_noncompact_digest (32-byte hash output) -T.4a.iv : flagsOrchard (1 byte) -T.4a.v : anchorOrchard (32 bytes) -T.4a.vi : nAGExpiryHeight (4 bytes)+
T.4a.i : orchard_actions_compact_digest (32-byte hash output) +T.4a.ii : orchard_actions_memos_digest (32-byte hash output) +T.4a.iii : orchard_actions_noncompact_digest (32-byte hash output) +T.4a.iv : orchard_zsa_burn_digest (32-byte hash output) +T.4a.v : flagsOrchard (1 byte) +T.4a.vi : anchorOrchard (32 bytes) +T.4a.vii : nAGExpiryHeight (4 bytes)
The personalization field of this hash is set to:
"ZTxIdOrcActGHash"
The personalization field of this hash is defined identically to ZIP 244:
"ZTxIdOrcActNHash"
A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the - \(\mathsf{assetBurn}\) - set, the following elements are included in the hash:
-T.4b.i : assetBase (field encoding bytes) -T.4b.ii: valueBurn (field encoding bytes)-
The personalization field of this hash is set to:
-"ZTxIdOrcBurnHash"-
In case the transaction does not perform the burning of any Assets (i.e. the - \(\mathsf{assetBurn}\) - set is empty), the ''orchard_zsa_burn_digest'' is:
-BLAKE2b-256("ZTxIdOrcBurnHash", [])-
The Asset Base being burnt encoded as the 32-byte representation of a point on the Pallas curve.
-Value of the Asset Base being burnt encoded as little-endian 8-byte representation of 64-bit unsigned integer (e.g. u64 in Rust) raw value.
+A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the + \(\mathsf{assetBurn}\) + set, the following elements are included in the hash:
+T.4a.iv.1 : assetBase (field encoding bytes) +T.4a.iv.2 : valueBurn (field encoding bytes)+
The personalization field of this hash is set to:
+"ZTxIdOrcBurnHash"+
In case the transaction does not perform the burning of any Assets (i.e. the + \(\mathsf{assetBurn}\) + set is empty), the ''orchard_zsa_burn_digest'' is:
+BLAKE2b-256("ZTxIdOrcBurnHash", [])
int64
varies
nAssetBurn
compactSize
40 * nAssetBurn
vAssetBurn
AssetBurn[nAssetBurn]
64
bindingSigOrchard
byte[64 * nActionsOrchard]
varies
nAssetBurn
compactSize
40 * nAssetBurn
vAssetBurn
AssetBurn[nAssetBurn]
The encoding of OrchardZSAAction
is described below.
The encodings of OrchardZSAAction
and AssetBurn
are described below.
proofsOrchardZSA
, and the elements of vSpendAuthSigsOrchard
, each have a 1:1 correspondence to the elements of vActionsOrchard
and MUST be ordered such that the proof or signature at a given index corresponds to the OrchardZSAAction
at the same index.