Skip to main content
@thru/passkey-manager is the root package for building transactions against the on-chain passkey_manager program. Use it when you are constructing passkey-backed wallet flows, validating passkey signatures, or deriving the addresses and account context needed for a passkey-managed transaction. Choose @thru/passkey-manager when you need the instruction builders, seeds, and account-context helpers around a passkey-managed wallet. Use @thru/passkey when you only need the browser WebAuthn registration and signing layer.

Install

npm install @thru/passkey-manager

Entry point

Import from the package root:
import {
  PASSKEY_MANAGER_PROGRAM_ADDRESS,
  encodeCreateInstruction,
  encodeValidateInstruction,
  createWalletSeed,
  buildAccountContext,
} from '@thru/passkey-manager';

What it gives you

Instruction builders

  • encodeCreateInstruction
  • encodeValidateInstruction
  • encodeTransferInstruction
  • encodeInvokeInstruction
  • encodeAddAuthorityInstruction
  • encodeRemoveAuthorityInstruction
  • encodeRegisterCredentialInstruction
  • concatenateInstructions

Transaction setup helpers

  • createWalletSeed
  • deriveWalletAddress
  • createCredentialLookupSeed
  • deriveCredentialLookupAddress
  • buildAccountContext
  • buildPasskeyReadWriteAccounts
  • parseWalletNonce
  • fetchWalletNonce
  • createValidateChallenge

Signature and encoding utilities

  • parseDerSignature
  • normalizeLowS
  • normalizeSignatureComponent
  • bytesToBigIntBE
  • bigIntToBytesBE
  • arrayBufferToBase64Url
  • base64UrlToArrayBuffer
  • bytesToBase64Url
  • base64UrlToBytes
  • bytesToHex
  • hexToBytes
  • bytesEqual
  • compareBytes
  • uniqueAccounts

Constants and types

  • PASSKEY_MANAGER_PROGRAM_ADDRESS
  • INSTRUCTION_CREATE
  • INSTRUCTION_VALIDATE
  • INSTRUCTION_TRANSFER
  • INSTRUCTION_INVOKE
  • INSTRUCTION_ADD_AUTHORITY
  • INSTRUCTION_REMOVE_AUTHORITY
  • INSTRUCTION_REGISTER_CREDENTIAL
  • AUTHORITY_TAG_PASSKEY
  • AUTHORITY_TAG_PUBKEY
  • Authority
  • AccountContext
  • CreateInstructionParams
  • ValidateInstructionParams
  • TransferInstructionParams
  • RegisterCredentialInstructionParams
  • WalletSigner
  • PasskeyMetadata
  • PasskeyRegistrationResult
  • PasskeySigningResult
  • PasskeyDiscoverableSigningResult
  • TransactionExecutionSummary

Typical flow

  1. Derive a wallet seed and wallet address.
  2. Build an account context so every account has a stable index in the transaction.
  3. Encode the transaction instructions you need.
  4. Create the validate challenge, sign it with WebAuthn, and package the signature into encodeValidateInstruction.

Good fit for

Use @thru/passkey-manager when you need to:
  • Build a passkey-managed wallet from scratch.
  • Submit a passkey signature to authorize a transaction.
  • Add or remove authorities on a wallet.
  • Register a credential or derive a credential lookup address.
  • Compose instruction payloads for server-side helpers or wallet backends.