Skip to content
Discussion options

You must be logged in to vote

We've got a new answer for this one! I've copied this in a stack overflow as well.

Example

https://github.com/aptos-labs/aptos-ts-sdk/blob/5cec8cecb6684ec37d379a62ae8df6a6fab06f61/tests/e2e/transaction/transactionBuilder.test.ts#L559-L579

Short answer (how to hash)

This has now been added to the TypeScript SDK, take a look here
aptos-labs/aptos-ts-sdk@5cec8ce

It basically does:

let prefix = SHA3-256("APTOS::Transaction")

SHA3-256([prefix, 0 byte, BCS encoded signed transaction])

Longer answer (How to hash)

Aptos hashes all types in a standard way. This is done by first creating a prefix, for every type. This is defined as a SHA3-256 of APTOS::<Type>
The struct type is here as Transaction

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@glant509
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ts-sdk Questions related to the TypeScript SDK
3 participants