@anywalletkit/seed-vault

中文文档
0.2.6发布于 2026/10/28Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 1729

Encrypted backups of wallet secrets for Any Wallet Kit: a versioned, self-describing envelope (XChaCha20-Poly1305 under a random data key) that one or more protectors unlock — a password through Argon2id, or a 32-byte key from a passkey PRF, an iCloud Key

原始使用文档
文档目录4 节
  1. Install
  2. The format
  3. Speed on phones
  4. What it is not

@anywalletkit/seed-vault

npm

An encrypted backup file for one wallet secret: a seed phrase or a private key, exactly as the keyring stores it. One file can be opened by one or more protectors:

Install

npm install @anywalletkit/seed-vault
# or: pnpm add @anywalletkit/seed-vault  ·  yarn add @anywalletkit/seed-vault

On npm: @anywalletkit/seed-vault, published from the release workflow with provenance.

ProtectorWhat opens itUse it for
passwordA password through Argon2id (19 MiB × 2 by default, at least 10 characters)A file in iCloud Drive / Google Drive / anywhere. Works across platforms.
keyAny ≥32-byte secret held somewhere elseA passkey PRF output, a random key in iCloud Keychain / Google Block Store, a hardware key's hmac-secret
import { sealBackup, openBackup, addProtector, encodeBackup, decodeBackup } from '@anywalletkit/seed-vault'

const secret = await secrets.get(sourceId)                       // the keyring's stored string
const meta = { type: source.type, fingerprint: source.fingerprint, label: source.label }
const file = encodeBackup(await sealBackup(secret, meta, [{ kind: 'password', password }]))

// later, on any device
const opened = await openBackup(decodeBackup(file), { kind: 'password', password })
if (opened.meta.fingerprint !== expected) …                      // compare before writing anything
await secrets.set(sourceId, opened.text())
opened.dispose()                                                 // zeroizes the bytes

The format

  • Payload: the secret is encrypted once with a random 32-byte data key (XChaCha20-Poly1305).
    • The header (format, version, created-at, meta) is authenticated as associated data.
    • Changing the fingerprint or label in the file makes it fail to open (corrupted).
  • Protectors: each one wraps the same data key with its own key-encryption key, and its descriptor is authenticated.
    • Lowering the Argon2 cost in the file, or renaming a key, makes that protector fail.
  • Changing protectors: addProtector / removeProtector change who can open the file without re-encrypting the secret. The last protector cannot be removed.
  • Decoding: decodeBackup is strict.
    • It refuses an unknown format, version, cipher or KDF, and it rebuilds the object from known fields only.
    • It bounds Argon2 costs (≤ 1 GiB, t ≤ 16), so a malicious file can't exhaust the phone's memory, and refuses a password protector below the cost this SDK seals with (19 MiB × 2), so a cheap-to-brute-force file is never taken for a normal backup.
  • Passwords: NFKC-normalized, so the same passphrase typed on different keyboards opens the file.

Speed on phones

Argon2id runs in pure JS by default, and that always works for opening a file.

EngineSeal or open (19 MiB × 2)
Hermesabout 6–15 s
V8 / Nodeabout 0.15 s

Show a native spinner while it runs.

With a native Argon2id you get under a second and can afford a stronger cost. Pass { argon2id: nativeImpl, argon2: { m: 64 * 1024, t: 3, p: 1 } }. The cost is stored in the file, so any device can still open it.

What it is not

  • It doesn't upload files. That is backup-cloud.
  • It doesn't store secrets on the device. That is @anywalletkit/secure-storage-react-native.
  • It doesn't split secrets into shares (Shamir). That is planned as an extra protector kind.
  • It doesn't use keystore v3 (Ethereum JSON) files.

版本与发布记录

@anywalletkit/seed-vault 共发布 8 个版本,首次发布于 2026/10/25;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.6latest2026/10/2813 天前
0.2.52026/10/2714 天前
0.2.42026/10/2615 天前
0.2.32026/10/2615 天前
0.2.22026/10/2515 天前
0.2.12026/10/2516 天前

关于 @anywalletkit/seed-vault 的常见问题

@anywalletkit/seed-vault 是什么?

Encrypted backups of wallet secrets for Any Wallet Kit: a versioned, self-describing envelope (XChaCha20-Poly1305 under a random data key) that one or more protectors unlock — a password through Argon2id, or a 32-byte key from a passkey PRF, an iCloud Key

如何安装 @anywalletkit/seed-vault?

在项目目录运行 npm install @anywalletkit/seed-vault,或使用 pnpm add / yarn add / bun add。

@anywalletkit/seed-vault 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@anywalletkit/seed-vault 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@anywalletkit/seed-vault 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@anywalletkit/seed-vault 可以商用吗?

@anywalletkit/seed-vault 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@anywalletkit/seed-vault 的下载量有多少?

根据 npm 官方下载统计,@anywalletkit/seed-vault 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,729 次,日均约 58 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@anywalletkit/seed-vault 还在维护吗?

最新版本 0.2.6 发布于 2026/10/28(13 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/10/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。