Skip to main content
Adds one or more Ed25519 signatures to a compiled transaction. Supply either private keys directly or seed+passphrase pairs — never both. State transitions: COMPILED + all required signers → FULLY_SIGNED. COMPILED + subset of signers → PARTIALLY_SIGNED. PARTIALLY_SIGNED + remaining signers → FULLY_SIGNED. See Transaction Lifecycle for the full state machine.
Private keys are transmitted in plaintext over the gRPC connection. Always use TLS in production. Never call this method over an unencrypted connection with real private keys.

Request

transaction
Transaction (object)
required
Transaction to sign. Must be in COMPILED or PARTIALLY_SIGNED state.
Supply either private_keys or seeds — never both. These are mutually exclusive signing methods.
private_keys
SignWithPrivateKeys (object) — one of
Sign using raw private keys.
seeds
SignWithSeeds (object) — one of
Sign using seed+passphrase pairs for key derivation.

Response

transaction
Transaction (object)
Transaction with added signatures. State is PARTIALLY_SIGNED or FULLY_SIGNED depending on how many required signers have signed.

Code Examples

// Sign with private keys
resp, err := client.SignTransaction(ctx, &transaction_v1.SignTransactionRequest{
    Transaction: compiledTxn,
    SigningMethod: &transaction_v1.SignTransactionRequest_PrivateKeys{
        PrivateKeys: &transaction_v1.SignWithPrivateKeys{
            PrivateKeys: []string{"YourBase58PrivateKey111111111111111111111111111"},
        },
    },
})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("State: %v\n", resp.Transaction.State)