Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
-----------------------------------------

<Note>
V4 is currently unstable and subject to changes. For this reason it targets Protocol Version ``Dev`` only.
</Note>

- **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
Expand Down Expand Up @@ -583,7 +579,7 @@ fn encode_optional_seed(optional_seed):
#### Create

<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode_node(create):
Expand Down Expand Up @@ -642,7 +638,7 @@ fn encode_optional_seed(optional_seed):
#### Exercise

<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode_node(exercise):
Expand Down Expand Up @@ -727,7 +723,7 @@ For Exercise nodes, the node seed **MUST** be defined. Therefore it is encoded a

<Tabs defaultTabIndex={1}>

<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode_node(fetch):
Expand Down Expand Up @@ -783,7 +779,7 @@ For Exercise nodes, the node seed **MUST** be defined. Therefore it is encoded a

#### Rollback
<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode_node(rollback):
Expand Down Expand Up @@ -821,7 +817,7 @@ Rollback nodes do not have an lf version.

This node type is only present in hashing scheme V3 and higher.
<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode_node(query_by_key):
Expand Down Expand Up @@ -868,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.

<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">

```
fn encode(metadata, prepare_submission_request):
Expand Down Expand Up @@ -947,7 +943,7 @@ fn hash(metadata):
Finally, compute the hash that needs to be signed to commit to the ledger changes.

<Tabs defaultTabIndex={1}>
<Tab title="V4 (unstable)">
<Tab title="V4">
```
fn encode(prepared_transaction):
0x00000030 || # Hash purpose
Expand Down