From 37c4f2d42a2275407b8ae75cd69238cac9b8b2d9 Mon Sep 17 00:00:00 2001 From: Rafael Guglielmetti Date: Wed, 26 Aug 2026 12:51:24 +0200 Subject: [PATCH 1/2] Enable hashing scheme V4 on protocol version 36 --- .../external-signing-hashing-algorithm.mdx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx b/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx index 58c986d88..0ab9c7183 100644 --- a/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx +++ b/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx @@ -37,7 +37,7 @@ The hashing algorithm is tied to the protocol version of the synchronizer used t |------------------|---------------------------| | v34 | V2 | | v35 | V2, V3 | -| dev | V2, V3, V4 | +| v36 | V2, V3, V4 | ### Transaction Nodes @@ -79,11 +79,7 @@ Additionally, this is the java library used under the hood in Canton to serializ Summary of differences between V3 and V4 ----------------------------------------- - -V4 is currently unstable and subject to changes. For this reason it targets Protocol Version ``Dev`` only. - - -- **New fields**: Exercise nodes with version ``dev`` include a new `external_call_results` field. This binds the recorded external-call result payloads shown in prepared transaction review to the external party's signature. +- **New fields**: Exercise nodes with protocol version 36 include a new `external_call_results` field. This binds the recorded external-call result payloads shown in prepared transaction review to the external party's signature. - **Final hash**: The hashing scheme version byte changes from ``0x03`` (V3) to ``0x04`` (V4). Summary of differences between V2 and V3 @@ -662,8 +658,8 @@ fn encode_optional_seed(optional_seed): encode(exercise.exercise_result) || encode(exercise.choice_observers) || encode(exercise.by_key) || - encode_key_with_maintainers(exercise.key) || - encode_external_call_result(exercise.external_call_results) || # new in V4 + encode(exercise.key) || + encode(exercise.external_call_results) || # new in V4 encode(exercise.children) ``` @@ -960,7 +956,7 @@ Finally, compute the hash that needs to be signed to commit to the ledger change ``` fn encode(prepared_transaction): 0x00000030 || # Hash purpose - 0x03 || # Hashing Scheme Version + hashing_scheme_version_byte || # e.g. 0x03 for V3, 0x04 for V4 hash(transaction) || hash(metadata) ``` From 9785cfa03fc2def78c86e0f895337f27400d41f2 Mon Sep 17 00:00:00 2001 From: Rafael Guglielmetti Date: Wed, 26 Aug 2026 13:41:49 +0200 Subject: [PATCH 2/2] Review comments --- .../external-signing-hashing-algorithm.mdx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx b/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx index 0ab9c7183..f39427e06 100644 --- a/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx +++ b/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx @@ -579,7 +579,7 @@ fn encode_optional_seed(optional_seed): #### Create - + ``` fn encode_node(create): @@ -638,7 +638,7 @@ fn encode_optional_seed(optional_seed): #### Exercise - + ``` fn encode_node(exercise): @@ -658,8 +658,8 @@ fn encode_optional_seed(optional_seed): encode(exercise.exercise_result) || encode(exercise.choice_observers) || encode(exercise.by_key) || - encode(exercise.key) || - encode(exercise.external_call_results) || # new in V4 + encode_key_with_maintainers(exercise.key) || + encode_external_call_result(exercise.external_call_results) || # new in V4 encode(exercise.children) ``` @@ -723,7 +723,7 @@ For Exercise nodes, the node seed **MUST** be defined. Therefore it is encoded a - + ``` fn encode_node(fetch): @@ -779,7 +779,7 @@ For Exercise nodes, the node seed **MUST** be defined. Therefore it is encoded a #### Rollback - + ``` fn encode_node(rollback): @@ -817,7 +817,7 @@ Rollback nodes do not have an lf version. This node type is only present in hashing scheme V3 and higher. - + ``` fn encode_node(query_by_key): @@ -864,7 +864,7 @@ fn hash(transaction): The final part of `PreparedTransaction` is metadata. Note that all fields of the metadata need to be signed. Only some fields contribute to the ledger change triggered by the transaction. The rest of the fields are required by the Canton protocol but either have no impact on the ledger change, or have already been signed indirectly by signing the transaction itself. - + ``` fn encode(metadata, prepare_submission_request): @@ -943,7 +943,7 @@ fn hash(metadata): Finally, compute the hash that needs to be signed to commit to the ledger changes. - + ``` fn encode(prepared_transaction): 0x00000030 || # Hash purpose @@ -956,7 +956,7 @@ Finally, compute the hash that needs to be signed to commit to the ledger change ``` fn encode(prepared_transaction): 0x00000030 || # Hash purpose - hashing_scheme_version_byte || # e.g. 0x03 for V3, 0x04 for V4 + 0x03 || # Hashing Scheme Version hash(transaction) || hash(metadata) ```