DOCS / SIGNING SCHEMES
Signing schemes
Choose the signed payload your application needs: an application message, EVM typed data, or a supported destination transaction. The same authority sources can approve each operation, but the signature format depends on the destination.
Choose the operation you need
| Method | What it does | Contacts a destination RPC? |
|---|---|---|
signMessage | Authorizes and signs an application message. | No |
signTypedData | Included in SDK 0.2.1: authorizes complete EIP-712 typed data for a selected EVM chain and returns a signature. Requires a service deployment that advertises this capability. | No |
signTransaction | Authorizes a typed transaction, signs its native payload and returns assembled bytes. | No |
signAndSend | Signs, assembles and broadcasts through the connection, RPC URL or callback supplied by your application. | Yes |
recover | Retrieves the original threshold-signing job and any saved signed bytes. | No |
recoverAndSend | Retrieves saved identical bytes and checks or optionally rebroadcasts them. | Yes |
All authority sources use the released methods after connect. Account wallets approve directly; program sources evaluate or commit application rules; passkey and OIDC/OAuth sources bind a fresh ephemeral approval key. This sign-in or approval proof authorizes the request; it is separate from the destination signature. None of these methods gives the browser a complete destination private key.
Message signing schemes
| Destination | Threshold scheme | Bytes signed for signMessage | Use boundary |
|---|---|---|---|
| Solana | FROST Ed25519 | UTF-8 application message bytes | Not Sign-In with Solana or a transaction signature. |
| NEAR | FROST Ed25519 | UTF-8 application message bytes | Not NEP-413 or a transaction signature. |
| Sui | FROST Ed25519 | UTF-8 application message bytes | Not Sui personal-message format; the live demo uses an application envelope. |
| EVM | DKLS23 ECDSA · secp256k1 | EIP-191 personal_sign digest of the UTF-8 message | The selected EVM destination is bound by PairKey approval and key selection; EIP-191 itself does not include a chain ID. |
| Bitcoin | FROST secp256k1 · BIP-340 output | PairKey-tagged SHA-256 digest of the hosted testnet network and message | Not BIP-322 or a BIP-341 transaction sighash. |
| Zcash | FROST RedPallas | UTF-8 application message bytes | Not Orchard SpendAuth or a shielded transaction signature. |
The hosted message input is 1–256 UTF-8 bytes. A relying application must verify the matching key, message encoding and domain. A message signature cannot be reused as a destination transaction signature.
EVM typed data · source preview
signTypedData signs the EIP-712 digest of a complete approved typed-data object, including its domain and message, with the selected EVM key. It returns a signature for the application to verify; it does not execute a transaction. SDK 0.2.1 includes this method and selectable EVM chain IDs, but they require a compatible service deployment. Check typed_data_signing.evm and evm_chain_selection in GET /api/v2/config. The current public service does not advertise either capability. See the EVM examples.
Transaction support by chain
| Chain | Accepted transaction | Signed output | Current boundary |
|---|---|---|---|
| Solana · Ed25519 | Serialized legacy or v0 transaction message. The derived key must be one of its required static signers. | Ed25519 signature; the browser SDK inserts it into Transaction or VersionedTransaction. | The application supplies recent blockhash, fee payer, address tables, instructions, and any other signatures. |
| EVM · secp256k1 | Typed EIP-155 legacy native transfer with nonce, gas price/limit, recipient, and value. | Complete signed legacy transaction bytes. | Public service uses Base Sepolia; chain selection is a source preview. EIP-1559, calldata, contract calls, access lists, and arbitrary RLP are not accepted. |
| NEAR · Ed25519 | Canonical Borsh Transaction with signer, matching access key, nonce, block hash, receiver, and bounded actions. | Complete Borsh SignedTransaction. | The derived key must already be installed as an account access key. PairKey does not create the NEAR account or add the key. |
| Sui · Ed25519 | BCS-serialized TransactionData bytes built with the derived Sui address as sender. | The original transaction bytes plus Sui’s 97-byte serialized signature: 0x00 || signature || public_key. | PairKey binds up to 1,197 transaction bytes and signs Blake2b-256([0,0,0] || transaction). The application builds the PTB and resolves gas; Sui validates BCS, sender and object state at execution. |
| Bitcoin | Source preview: canonical testnet PSBT v0 with one PairKey-owned Taproot key-path input and one or two exact outputs. | Signed PSBT and finalized raw transaction. | Requires an updated service and SDK. Both workers validate complete previous transaction and UTXO, fee caps and BIP-341 SIGHASH_DEFAULT. Public deployment does not yet advertise it. |
| Zcash | Testnet library alpha: v6 Ironwood PCZT v2 with one real spend and one output. | Spend authorization signature inserted into a PCZT in source tests; no hosted output. | No hosted or published SDK support, wallet/prover integration, or ZIP 2005 recovery guarantee. The wallet must finish witnesses, proofs, binding authorization and broadcast. |
The deployment advertises transaction adapters in GET /api/v2/config → transaction_signing. A typed-data signature, message signature and transaction signature authorize different payloads. In particular, placing a transaction digest in a signMessage string does not produce a valid chain transaction signature.
Build, sign, and send
Install @pairkey/sdk and @solana/web3.js; the import below uses the released package.
import * as web3 from '@solana/web3.js';
import {PairKeyClient} from '@pairkey/sdk';
const pairkey = new PairKeyClient({web3, storage: localStorage});
await pairkey.connect({
source: 'account', wallet: window.phantom.solana,
namespace: 'org/acme/treasury'
});
// Construct and inspect this with the normal destination-chain SDK.
const transaction = new web3.VersionedTransaction(message);
// Signs and assembles, but does not contact a destination RPC.
const signed = await pairkey.signTransaction({
chain: 'solana', path: [0], transaction
});
// Or sign, submit, and optionally wait for the destination response.
const sent = await pairkey.signAndSend({
chain: 'solana', path: [0], transaction, connection
});
console.log(sent.jobId, sent.transactionId, sent.status);
Sui example
Build the transaction with the Sui SDK before asking PairKey to sign. PairKey returns signedTransaction for the unchanged BCS TransactionData and serializedSignature for Sui’s Base64 signature parameter.
import {Transaction} from '@mysten/sui/transactions';
const key = await pairkey.key({chain: 'sui', path: [0]});
const tx = new Transaction();
tx.setSender(key.address);
tx.transferObjects([tx.gas], tx.pure.address('0x…recipient'));
// The Sui client resolves gas and returns BCS TransactionData bytes.
const transaction = await tx.build({client: suiClient});
const signed = await pairkey.signTransaction({
chain: 'sui', path: [0], transaction
});
console.log(signed.signedTransaction, signed.serializedSignature);
// Uses suiClient.executeTransaction({transaction, signatures, include}).
const sent = await pairkey.signAndSend({
chain: 'sui', path: [0], transaction, connection: suiClient
});
A custom broadcaster receives the transaction bytes as its first argument and can read signed.serializedSignature from the second. This also works with account, program, passkey and OIDC/OAuth authority sources; their difference is the PairKey approval proof, not the derived Sui key.
- Build: use the destination SDK and RPC to choose the current nonce or block hash, fees, recipient, value, instructions, and action data.
- Authorize: PairKey commits the complete typed transaction envelope to the exact request. Account/program approval or a passkey or OIDC/OAuth ephemeral binding authenticates that request.
- Sign: both workers independently validate the envelope and derive the chain-native signing bytes before participating.
- Assemble: the SDK attaches the signature or returns complete signed transaction bytes.
- Send:
signAndSenduses the connection, RPC URL, or broadcast callback supplied by your application. PairKey's signing service does not broadcast to destination chains.
Handle uncertain outcomes
The SDK saves public signing recovery data before the authentication prompt and saves the exact signed transaction before the first broadcast call. A destination RPC timeout returns status: "unknown"; it does not claim the transaction failed or was never accepted.
if (sent.status === 'unknown') {
// Recovers the same threshold-signing job. No new approval or signature.
const recovered = await pairkey.recoverAndSend(sent.jobId, {
chain: 'solana', connection, rebroadcast: true
});
}
Rebroadcast only the recovered identical bytes. Before constructing a replacement with a new nonce, check the destination chain for the original transaction where possible. A completed threshold signature proves signing; an RPC transaction ID proves submission; a finalized destination receipt proves execution. These are separate states.
What policy can enforce
Standard PairKey rules bind destination, derivation path, canonical payload length, and optional byte prefix. Program policies can decode the transaction envelope and enforce application-specific recipients, amounts, contracts, actions, or budgets. The supplied example controller demonstrates destination/path/payload limits and an approval counter; it does not decode every chain transaction into financial policy.
A program can use a namespace-scoped policy PDA at ["pairkey-policy", owner, namespace_digest] or the compatible shared PDA at ["pairkey-policy", owner]. Namespace scope prevents one owner's policy update from silently changing another named namespace.
Operational limits
Hosted v2 is a public development deployment with two development signers on one host. The complete canonical approval payload is bounded to 1,232 bytes, leaving 1,197 bytes for Sui TransactionData after PairKey’s transaction envelope; NEAR unsigned transactions are bounded to 1,024 bytes. EVM numeric JSON fields must fit the SDK's browser-safe integer representation. Sui message signing in the live demo signs the displayed PairKey application envelope; it is not Sui personal-message signing. Transaction signing is not atomic with Solana approval or destination execution. Onchain program approval can consume an allowance even when signing or later delivery fails. Verify the key, chain signature, exact approval, and both worker receipts against trusted signer identities before relying on output.
Implementation source: Ed25519 transaction adapters, Sui hashing and serialization, EVM adapter, and browser client. Sui format references: transaction authentication and SDK signing and execution.