
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
@thru/passkey-manager
Advanced tools
Platform-agnostic TypeScript library for interacting with the on-chain `passkey_manager` program. It provides ABI-generated instruction builders, P-256 cryptographic utilities, and helpers for constructing passkey-authenticated transactions. Works in brow
Platform-agnostic TypeScript library for interacting with the on-chain passkey_manager program. It provides ABI-generated instruction builders, P-256 cryptographic utilities, and helpers for constructing passkey-authenticated transactions. Works in browsers, React Native, and Node.js.
npm install @thru/passkey-manager
import {
encodeCreateInstruction,
encodeValidateInstruction,
encodeTransferInstruction,
concatenateInstructions,
createWalletSeed,
deriveWalletAddress,
buildAccountContext,
createValidateChallenge,
parseDerSignature,
normalizeLowS,
PASSKEY_MANAGER_PROGRAM_ADDRESS,
} from '@thru/passkey-manager';
// Derive a wallet address from a passkey's public key
const seed = await createWalletSeed('my-wallet', pubkeyX, pubkeyY);
const walletAddress = await deriveWalletAddress(seed, PASSKEY_MANAGER_PROGRAM_ADDRESS);
// Build account context for the transaction
const ctx = buildAccountContext({
walletAddress: 'taWalletAddress...',
readWriteAccounts: [recipientBytes],
readOnlyAccounts: [],
});
// Encode instructions using ABI-generated builders
const create = encodeCreateInstruction({
walletAccountIdx: ctx.walletAccountIdx,
authority: { tag: 1, pubkeyX, pubkeyY },
seed,
stateProof,
});
const transfer = encodeTransferInstruction({
walletAccountIdx: ctx.walletAccountIdx,
toAccountIdx: ctx.getAccountIndex(recipientBytes),
amount: 1_000_000n,
});
// Combine multiple instructions into a single payload
const payload = concatenateInstructions([create, transfer]);
// Build the challenge that the passkey must sign
const challenge = await createValidateChallenge(nonce, ctx.accountAddresses, payload);
import {
parseDerSignature,
normalizeLowS,
encodeValidateInstruction,
} from '@thru/passkey-manager';
// Parse the DER-encoded signature from WebAuthn
const { r, s } = parseDerSignature(derSignatureBytes);
const normalizedS = normalizeLowS(s);
// Encode the validate instruction with the parsed signature
const validate = encodeValidateInstruction({
walletAccountIdx: ctx.walletAccountIdx,
authIdx: 0,
signatureR: r,
signatureS: normalizedS,
authenticatorData,
clientDataJSON,
});
Each instruction maps to an on-chain passkey_manager program handler. All builders use ABI-generated types for type-safe serialization.
| Function | Description |
|---|---|
encodeCreateInstruction | Create a new passkey-managed wallet account |
encodeValidateInstruction | Submit a passkey signature for transaction authorization |
encodeTransferInstruction | Transfer lamports from a managed wallet |
encodeInvokeInstruction | Invoke a cross-program instruction from a managed wallet |
encodeAddAuthorityInstruction | Add a passkey or pubkey authority to a wallet |
encodeRemoveAuthorityInstruction | Remove an authority from a wallet |
concatenateInstructions | Combine multiple encoded instructions into one payload |
Platform-agnostic P-256 / ECDSA helpers that do not depend on any native crypto library beyond crypto.subtle:
parseDerSignature -- extract r and s components from a DER-encoded ECDSA signaturenormalizeLowS -- enforce low-S form (BIP-62 / SEC1 compliance)normalizeSignatureComponent -- pad or trim a signature component to exactly 32 bytesbytesToBigIntBE / bigIntToBytesBE -- big-endian bigint conversionP256_N / P256_HALF_N -- P-256 curve order constantsZero-dependency byte manipulation functions:
arrayBufferToBase64Url / base64UrlToArrayBuffer -- ArrayBuffer base64url conversionbytesToBase64Url / base64UrlToBytes -- Uint8Array base64url conversionbytesToHex / hexToBytes -- hex string conversionbytesEqual / compareBytes -- byte array comparisonuniqueAccounts -- deduplicate account byte arrayscreateWalletSeed(walletName, pubkeyX, pubkeyY) -- derive a deterministic 32-byte seed from a wallet name and passkey public key coordinates via SHA-256deriveWalletAddress(seed, programAddress) -- derive the on-chain PDA for a managed walletbuildAccountContext(params) -- build a sorted, deduplicated account context with index lookup for transaction constructionparseWalletNonce(data) / fetchWalletNonce(sdk, address) -- read the current nonce from on-chain wallet account dataimport type {
PasskeyMetadata,
PasskeyRegistrationResult,
PasskeySigningResult,
PasskeyDiscoverableSigningResult,
Authority,
AccountContext,
CreateInstructionParams,
ValidateInstructionParams,
TransferInstructionParams,
WalletSigner,
TransactionExecutionSummary,
} from '@thru/passkey-manager';
| Type | Description |
|---|---|
PasskeyMetadata | Local metadata for a registered passkey (credential ID, public key, RP ID) |
PasskeyRegistrationResult | Result of WebAuthn credential creation |
PasskeySigningResult | Parsed WebAuthn assertion with raw r/s components |
PasskeyDiscoverableSigningResult | Signing result that includes the discovered credential ID |
Authority | Tagged union for passkey (P-256) or pubkey (Ed25519) authorities |
AccountContext | Sorted account list with index lookup for transaction building |
FAQs
Platform-agnostic TypeScript library for interacting with the on-chain `passkey_manager` program. It provides ABI-generated instruction builders, P-256 cryptographic utilities, and helpers for constructing passkey-authenticated transactions. Works in brow
We found that @thru/passkey-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.