SoroPass
SDK

SDK

A minimal, headless, ES256-only passkey SDK for Stellar smart accounts.

A minimal, headless, ES256-only passkey SDK for Stellar smart accounts.

Strengths

MetricWhat it meansDetail
~1.85 KBTiny coregzip; subpaths from 0.2 KB
ES256-onlyHard-failnon-P256 rejected at creation
Low-SAlwaysnormalized before any contract
10 codesTyped errorsfrozen, exhaustive

Subpaths & import map

Each subpath is independently importable — tree-shaking is the headline. @stellar/stellar-sdk is a peer dep, never bundled.

SubpathWhat it givesBundle
.Public surface5.6 KB · ~1.85 KB gz
/createcreatePasskey, assertES256~476 B
/connectconnect()~208 B
/recoverrecover()~238 B
/signsignTransaction, normalizeLowS605 B · ~349 B gz
/typesKitError, guards235 B · ~182 B gz
/testingmockAuthenticator (dev-only)7.5 KB

The heavy crypto (noble) is shared and pulled only when /sign or /create is imported.

API reference

Each area has its own page — signatures, options, returns, and a runnable example, generated from the real types.

Try it — low-S round-trip

A real, runnable computation against the secp256r1 order n. Edit S or reflect it; watch isLowS flip and normalizeLowS bring it back.

The runner reflects a signature scalar S across the secp256r1 order n. When forceHighS is set via mockAuthenticator, isLowS() returns false, and normalizeLowS() brings it back to the low half by computing n − S:

// secp256r1 order
const N = BigInt('0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551');
const HALF = N >> 1n;

function isLowS(S: bigint): boolean {
  return S <= HALF && S > 0n;
}

function normalizeLowS(S: bigint): bigint {
  return S > HALF ? N - S : S;
}

forceHighS via mockAuthenticatorisLowS() === falsenormalizeLowS() reflects S → n − S, after which isLowS(normalized) === true.

Try it — feed it a bad input

Each failure throws a real, code-grounded KitError, and the SDK renders the actual errorView. One taxonomy → one layout.

Bad inputKitError code / causeWhere it's enforced
RS256 / non-P256 keyES256_NOT_SUPPORTEDceremonies/create.ts asserts alg === −7
Malformed / >72-byte DERINVALID_SIGNATURE_DERwebauthn/signature.ts derToCompact
High-S signature (forceHighS)isLowS() === falsenormalizeLowS reflects to n − S
Unreadable COSE keyINVALID_PUBLIC_KEYcoseKeyToSec1 throws
Origin / challenge mismatchORIGIN_MISMATCH / CHALLENGE_MISMATCHverifyClientDataJSON

A raw KitError looks like:

{
  "code": "ES256_NOT_SUPPORTED",
  "cause": "ceremonies/create.ts asserts alg === −7"
}

One frozen 10-code taxonomy → one error layout, copy swapped by code. See the full taxonomy.

On this page