Skip to content

feat(sdk): Vector TypeScript SDK — facade, per-scheme entrypoints, inspection, migration scanner#9

Open
L0STE wants to merge 14 commits into
masterfrom
feat/branching-sdk
Open

feat(sdk): Vector TypeScript SDK — facade, per-scheme entrypoints, inspection, migration scanner#9
L0STE wants to merge 14 commits into
masterfrom
feat/branching-sdk

Conversation

@L0STE

@L0STE L0STE commented Jun 18, 2026

Copy link
Copy Markdown

Summary

A TypeScript SDK for Vector: a scheme-agnostic Vector facade plus offline artifact inspection and fund-in-PDA migration tooling. You authorize work in plain Solana instructions; the SDK wires the advance + passthrough and the transaction layout.

Modular by scheme — install/bundle only what you use

The default vector-sdk entrypoint is scheme-agnostic and pulls no per-scheme crypto (only @noble/curves/ed25519 for PDA derivation + native crypto). Construct a Vector from its scheme's subpath:

Subpath Constructor Pulls
vector-sdk/ed25519 vectorEd25519(seed) @noble/curves/ed25519
vector-sdk/secp256k1 vectorSecp256k1(privKey) @noble/curves/secp256k1
vector-sdk/eip191 vectorEip191(privKey) secp256k1 + keccak — sign with any Ethereum wallet
vector-sdk/falcon512 vectorFalcon512(keypair) @noble/post-quantum (optional peer dep)
vector-sdk/hawk512 vectorHawk512(keypair) @blueshift-gg/hawk512 (optional peer dep)

Importing a scheme subpath also registers its offline verifier. SHA-256/HKDF use native crypto (no @noble/hashes for those). Dependency isolation is verified in the built dist.

The post-quantum libraries (@noble/post-quantum, @blueshift-gg/hawk512) are optional peer dependencies — a base install pulls neither. ed25519 / secp256k1 / eip191 users install zero post-quantum code; add @noble/post-quantum only for vector-sdk/falcon512 and @blueshift-gg/hawk512 only for vector-sdk/hawk512.

Surface

Facade (Vector): authorize(nonce, op) (op = Instruction | Instruction[], [] = revoke), chain (ordered, forward-secure), branch (sign N, execute one), withdraw / close, derive (independent sub-accounts), register / initialize, status, nonce (the only async call). Signing is synchronous and offline (air-gapped friendly).

Inspection (core): serializeArtifact / deserializeArtifact, decodeOps, summarize, review, verifyArtifact — offline verification for all five schemes via a registry the scheme subpaths populate on import.

Migration (wallet / migrate / scan): fund-in-PDA helpers + migration builders + scanMigration — audits whether an old authority's native SOL, SPL + Token-2022 accounts, stake accounts, and declared mint/freeze authorities have moved to the PDA; report.complete gates the deprecation cutoff.

Low-level chain engine: vector-sdk/branching.

Tests

  • 48 unit + 8 on-chain integration against solana-test-validator (ed25519 / secp256k1 / eip191 / hawk512 programs): forward-secrecy ordering, branch exclusivity, sub-account independence, the secp256k1 / eip191 / Hawk-512 facade flows, Hawk's 3-tx registration, fund-in-PDA SOL spend, scanMigration against live RPC, and offline verify across all five schemes.
  • tsc --noEmit clean.

Notes / follow-ups

  • Hawk-512 registration is three transactions (register() returns the ordered groups); its advance carries a compute-budget bump committed to by the digest. derive is available for the 32-byte-key schemes; post-quantum sub-accounts are built from their own keypairs.
  • Runnable use-case examples (cold ceremony / policy-gated / staking / token-admin / RFQ) are a planned follow-up.

Usage guide: sdk/ts/README.md.

@L0STE L0STE changed the title feat(sdk): Vector TypeScript SDK — facade, inspection, migration scanner feat(sdk): Vector TypeScript SDK — facade, per-scheme entrypoints, inspection, migration scanner Jun 18, 2026
Move @noble/post-quantum and @blueshift-gg/hawk512 from dependencies to
optional peerDependencies (with peerDependenciesMeta optional: true) and
devDependencies. ed25519 / secp256k1 / eip191 users now install zero
post-quantum code; falcon512 / hawk512 users add the one library their
subpath needs. README documents the install model.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant