halkyon/packages/halkyon_keys/pubspec.yaml
Tizian 「ティツィアーン」 3bc0bae6e3
feat(keys): halkyon_keys, an account's keys on the device
ADR 0017's step 1, on libsodium (sodium 4.1.0+1, whose build hook
compiles the libsodium 1.0.22 it ships: a C compiler and make wherever
it builds):
- Argon2id (64 MiB, 3 passes, kept with the account and never below
  that) makes a master key, which libsodium's KDF splits into SRP's
  secret (x) and the key-encryption key.
- The account's X25519 and Ed25519 key pairs, their private halves
  wrapped with XChaCha20-Poly1305 under the KEK and under the recovery
  key, bound to their public keys.
- A 24-word BIP-39 recovery phrase (the English list, MIT) and the
  recovery key derived from it.
- Data keys sealed to the account with crypto_box_seal, bound to their
  IDs; content in ADR 0002's envelope, encrypted with a data key and
  signed with Ed25519 (detached), bound to a context the caller names.
- Secrets in libsodium's guarded memory where its API takes them.
- Tests: libsodium's Argon2id known answers, BIP-39's English vectors,
  round trips and every refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-22 18:11:09 +02:00

26 lines
1,010 B
YAML

name: halkyon_keys
description: >-
An account's keys on the device (ADR 0017): the password's Argon2id key and
what it splits into, the account's key pairs and their wrapping, the recovery
phrase, data keys sealed to the account, and content encrypted and signed in
ADR 0002's envelope. libsodium does every primitive.
version: 0.1.0
publish_to: none
resolution: workspace
environment:
sdk: ^3.13.0
dependencies:
# SHA-256, which BIP-39's checksum is made with.
crypto: ^3.0.7
# libsodium's API (Argon2id, X25519, Ed25519, XChaCha20-Poly1305, sealed
# boxes, the KDF), pinned exactly: what keys an account's data must never
# move by accident. Its build hook compiles libsodium 1.0.22 from the source
# it ships (no download; a C compiler and make on every machine that builds),
# which replaced sodium_libs's prebuilt binaries. 4.1.0+1, as 4.1.1 on needs
# code_assets 2, which Learn's mecab_for_dart (2.0.5) doesn't allow yet.
sodium: 4.1.0+1
dev_dependencies:
test: ^1.31.1