mirror of
https://github.com/luxfi/keys.git
synced 2026-07-26 23:58:11 +00:00
f6d7abb34696dceb3e557bcba995d8d5f96cd951
Decomplecting: KMS is the generic secret store; this package owns BIP-39
and mnemonic semantics. The shared LoadMnemonic loader belongs HERE,
not inside luxfi/kms, because the BIP-39 validation + (env-then-KMS)
precedence chain is application-layer behavior over the opaque
Get/Put/List surface KMS exposes.
New API (mirrors what luxfi/kms briefly carried at v1.9.12 — moving
upstream to its real home):
keys.LoadMnemonic(ctx, addr, env, path) env-then-KMS
keys.LoadMnemonicFromKMS(ctx, addr, env, path) KMS-only
keys.SplitSecretPath("/foo/bar") ("/foo/", "bar")
Composes:
luxfi/kms/pkg/zapclient transport-only secret reads
luxfi/go-bip39 phrase validation
Tests: 10 cases covering env-wins, env-invalid-fails-fast, KMS happy
path, missing-args validation, dial-error, GetAt-error, empty +
invalid-shape responses, and the path-split convention.
Layer responsibilities now clean:
zap-proto/zap protocol (transport)
luxfi/kms opaque secret store over zap
luxfi/keys THIS — BIP-39 + BIP44 + mnemonic-from-KMS semantics
consumers luxd, lux/cli, netrunner, descending-L1 bootstraps
Follow-up: luxfi/kms v1.9.13 will strip its temporary LoadMnemonic*
helpers (added in v1.9.12 + tagged but unmerged in PR luxfi/kms#5).
Languages
Go
100%