<>ts-stack
Get StartedArchitecturePackagesSpecsGuides
⌘K
Reference
Home
Get StartedOverviewInstallChoose your stackKey concepts
ArchitectureOverviewStack layersBEEF (BRC-62)BRC-100 Wallet InterfaceIdentity & AuthConformance pipeline
PackagesOverviewSDKWalletNetworkOverlaysMessagingMiddleware
@bsv/auth-express-middleware@bsv/payment-express-middleware@bsv/402-pay
Helpers
InfrastructureOverviewmessage-box-serveroverlay-serveruhrp-server-basicuhrp-server-cloud-bucketwabwallet-infrachaintracks-server
SpecsOverviewBRC-100 Wallet InterfaceOverlay HTTPMessage-box HTTPAuthsocket (WebSocket)BRC-31 Auth HandshakeBRC-29 Peer PaymentBRC-121 / HTTP 402ARC BroadcastMerkle ServiceStorage AdapterGASP SyncUHRPAir-Gap Optical (BRC-141)
ConformanceOverviewVector catalogTS runnerContributing vectors
GuidesOverviewBuild a wallet-aware appRun an overlay nodePeer-to-peer messagingHTTP 402 payments
ReferenceOverviewBRC indexRepository health
AboutVersioningContributingDoc agentDocumentation sources
npmhttps://www.npmjs.com/package/@bsv/authv0.1.3betaAPI reference (TypeDoc) ↗
Loading…
Edit this page on GitHub
© 2026 BSV Blockchain. ts-stack is open-source.
GitHubContributingVersioning

@bsv/auth

@bsv/auth provides framework-neutral, expiry-bound, single-use wallet authentication proofs. It separates proof creation and verification from HTTP, Express, and database choices.

Install

Install the SDK peer dependency with the package:

bash
npm install @bsv/auth @bsv/sdk

Public API

  • AuthProofClient and createAuthProof create an action-bound proof with a wallet.
  • AuthProofServer and verifyAuthProof verify the signature, identity, action, expiry, and nonce.
  • checkAuthSigData, createAuthSigData, and serializeAuthSigData expose the lower-level proof data contract.
ts
import { AuthProofClient, AuthProofServer } from '@bsv/auth'

const options = { protocol: [2, 'example auth'] as [2, string] }
const client = new AuthProofClient(options)
const server = new AuthProofServer(options)

Client and server must use the same protocol. Production verification must inject an atomic consumeNonce implementation. A process-local map is suitable only for one process; replicated or restarting services need a shared store with uniqueness and expiry.

The package publishes strict ESM and CommonJS entry points and supports Node.js 22 or newer. See the package README for a complete client/server example and store guidance.

License

Open BSV License Version 6. See the package license.