Signatures for unsupported chains
Build a transaction yourself, sign it with the io.sign API, and broadcast it through your own node
Treasury builds and broadcasts transactions for its supported blockchains. For any other chain that uses a signature algorithm io.sign supports, you can build the transaction yourself, sign it through the io.sign API, and broadcast it through your own node. Your vault's signers review and approve each request as usual.
If you would rather we support the chain in Treasury, request it.
How it works
- Build the unsigned transaction with the chain's SDK.
- Work out the bytes to sign for the algorithm the chain uses. See Choose the algorithm.
- Create a signature request with
POST /v2/vaults/{vaultId}/signatures. - Wait for your signers to approve. Poll
GET /v2/vaults/{vaultId}/signatures/{id}until the status iscompleted, or subscribe to webhooks. - Attach the signature to the transaction, verify it locally against the vault's public key, and broadcast it through your own node.
io.sign never builds or broadcasts the transaction. It returns a raw signature, so your application owns the fee, nonce or sequence, and expiry handling for the chain.
Choose the algorithm
Set coseAlgorithm to match the chain's curve and hashing, and verify against the vault's public key for that curve. io.sign processes dataToSign differently for each algorithm:
coseAlgorithm | Curve | What io.sign does with dataToSign | Typical chains |
|---|---|---|---|
es256k | secp256k1 | Hashes the bytes once with SHA-256, then signs | Bitcoin-family chains |
eskec256 | secp256k1 | Hashes the bytes once with Keccak-256, then signs | EVM-compatible chains |
eddsa | Ed25519 | Signs the bytes as supplied | Solana, XRP Ledger (Ed25519 keys), and other Ed25519 chains |
Because es256k and eskec256 hash what you send, send the bytes that come before the chain's final hash, not the final digest. For example, send an EVM chain's unsigned serialised transaction, or the first SHA-256 of a Bitcoin signature preimage. Sending a final digest hashes it twice and produces a signature the chain rejects.
A chain whose signing hash doesn't match one of these, such as XRP Ledger secp256k1 keys (which use SHA-512Half), can't use that key type through io.sign. Use an Ed25519 key on that chain if it supports one, or contact us.
The API also accepts eddsa_blake2b. Contact us before using it for a new chain.
Create the signature request
Send the bytes as hexadecimal without a 0x prefix. This example asks for an EVM-style signature:
curl --fail-with-body --request POST \
"${IO_SIGN_API_URL}/v2/vaults/${VAULT_ID}/signatures" \
--header "Authorization: Bearer ${IO_SIGN_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{
"expiresAt": "<ISO-8601 time at least 10 minutes from now>",
"signatures": [
{
"coseAlgorithm": "eskec256",
"contentType": "application/octet-stream+hex",
"dataToSign": ["<unsigned-transaction-hex>"]
}
]
}'Add derivationPath (for example m/0/1) to sign with a non-hardened child key. Then build and verify against that child key's public key and address.
Save the returned id. If the request fails with a network error, list the vault's signature requests before you submit again: the original may have been created.
Use the signature
When the request is completed, read signatures[0].signature. It holds one hex string for each dataToSign entry:
- The first 64 bytes are the signature:
randsfor secp256k1, or the Ed25519 signature. - A recovery suffix follows. Use it as the recovery ID if your chain needs one, and drop it otherwise. If you set
chainId, an EVM recovery value can be longer than one byte.
Before you broadcast, verify the signature against the vault's public key and the exact transaction, and check that the address it recovers or verifies is the vault's address. If the transaction changes (for example the fee, nonce, or recent block reference), it needs a new signature request.
Worked examples
Sign and broadcast transactions has complete scripts for Bitcoin, EVM, Solana, and XRP. They follow the same steps, and are a useful starting point for a chain that shares one of their algorithms.
Updated 17 days ago