TON supports the following signature kinds:
Message, unsigned external-in message in BoC format.
Hash, a generic 32-byte hash. See Sign.
Message
Signs an unsigned external-in message in BoC format. Note: successful signing doesn’t return signedData. Constructing the broadcast data depends on the target smart contract.
message must be a serialized BoC (hex, starting with b5ee9c72). To sign a raw 32-byte hash, use kind: Hash instead; passing a raw hash as a Message fails with an “Invalid magic” error.
Typescript Example with ton-core
First install ton-core. You can find the full documentation here: https://github.com/ton-org/ton
Ton requires a specific message format when interacting with the network. We need to create a signing message payload BoC. Then, we can sign the BoC via the DFNS TypeScript SDK: