DOCS / QUICKSTART
Build with hosted signers.
All four authority sources follow the same derive, sign, send and recover lifecycle. Choose the proof your users can safely operate.
npm install @pairkey/sdk
Choose an authority
What changes between sources?
| Source | Connect with | User action for signing | Ordinary approval cost on Solana |
|---|---|---|---|
| Account | wallet | Sign a wallet message | No transaction or rent |
| Program | program, owner wallet and mode | Program caller proof; optional approval transaction | None in Offchain mode; transaction in Onchain mode |
| Passkey | Verified credential identity and ID | Complete a WebAuthn assertion | No transaction or rent |
| OIDC/OAuth | Issuer, audience, subject and token callback | Complete provider login for a fresh nonce | No transaction or rent |
Passkey and OIDC/OAuth sign-in authenticate the authority for an exact PairKey request. The derived destination key uses its own chain signing scheme; a sign-in token or WebAuthn assertion is not the destination signature.
The common application flow
import * as web3 from '@solana/web3.js';
import {PairKeyClient} from '@pairkey/sdk';
const pairkey = new PairKeyClient({web3, storage: localStorage});
// Source-specific. See one of the four guides above.
await pairkey.connect({source, namespace, ...authentication});
// Common to every source.
const key = await pairkey.key({chain: 'solana', path: [0]});
const signed = await pairkey.signMessage({
chain: 'solana', path: [0], message: 'Approve this exact message.'
});
Use Keys & namespaces to choose a stable naming and path plan before funding derived addresses.
Sign or send a transaction
// Assemble without contacting a destination RPC.
const signed = await pairkey.signTransaction({chain, path, transaction});
// Or assemble and broadcast through an RPC supplied by your application.
const sent = await pairkey.signAndSend({
chain, path, transaction, connection, rpcUrl
});
Your application builds the transaction and chooses fees, recipients, actions and destination RPC. PairKey authenticates the exact canonical transaction, produces its signature and attaches it using the supported adapter.
Add policy deliberately
No saved policy is required to derive a key or approve the first request. Optional rules add persistent restrictions. Creating or editing them is a separate Solana transaction and should happen only when the administrator deliberately changes policy. A program can additionally consume a nonce, allowance or proposal in Onchain approval mode.
Recover the original attempt
const result = await pairkey.recover(jobId);
if (sent.status === 'unknown') {
await pairkey.recoverAndSend(sent.jobId, {
chain: 'solana', connection, rebroadcast: true
});
}
Recovery retrieves the same job and signed bytes. It does not request another approval or create another signature. Save the public recovery record before submission and treat a timeout as uncertain until signing and destination status are checked.
Check availability
The hosted configuration advertises supported sources, signer identities, transaction adapters and example program. Use the released @pairkey/sdk package with the destination use cases and supported operations. Check development deployment status before using valuable funds.