Skip to content

Seedphrase encryption tool via KMS - #13

Merged
Jossec101 merged 2 commits into
developfrom
feat/seed-ceremony
Aug 19, 2026
Merged

Seedphrase encryption tool via KMS#13
Jossec101 merged 2 commits into
developfrom
feat/seed-ceremony

Conversation

@Jossec101

Copy link
Copy Markdown
Contributor

This PR introduces a new binary to simplify key rotations via creating/using a new BIP39 seedphrase and encrypting it generating a manifest that can be used safely to modify nodeguard db and lambda functions for remote signer


Stack created with GitHub Stacks CLIGive Feedback 💬

Comment thread RemoteSigner.SeedCeremony/Commands/EncryptAndEmit.cs
Comment thread RemoteSigner.SeedCeremony/Commands/EncryptCommand.cs
Comment thread RemoteSigner.SeedCeremony/ConsoleSafety.cs
Comment thread RemoteSigner.SeedCeremony/ConsoleSafety.cs
Comment thread README.md
stack merge was automatically disabled August 19, 2026 13:34

Pull Request is not mergeable

stack merge was automatically disabled August 19, 2026 13:34

Pull Request is not mergeable

Base automatically changed from deps/bump to develop August 19, 2026 13:36
New console project RemoteSigner.SeedCeremony (assembly 'seed-ceremony')
replacing the old provisioning flow of pasting the mnemonic into the
GenerateEncryptedSeedTest unit test. It references the RemoteSigner project
and reuses its SignPSBTConfig/EncryptSeedphrase/DecryptSeedphrase/
ParseNetwork, so the emitted MF_* env var is compatible by construction.

Commands:
- generate: fresh 24-word mnemonic (interactive TTY enforced, shown once,
  backup quiz, screen+scrollback wipe), KMS-encrypt, emit manifest
- encrypt: same for an existing mnemonic (--seed-file or hidden prompt,
  never argv)
- verify: preflight gate - KMS-decrypts the manifest env value through the
  lambda's own decrypt path and re-derives fingerprint/env name/xpub

The manifest holds public data only (env name/value, master fingerprint,
account xpub, derivation path, network). AWS credentials come from the
default chain, optionally --profile/--region.

Function.cs: additive refactors only - EncryptSeedphrase overload with an
injected IAmazonKeyManagementService and public static DecryptSeedphrase
extracted from DecryptSeed (existing signatures delegate).

Also: 10 new tests (derivation matches NodeGuard's InternalWallet.GetXPUB,
env value round-trips the lambda's deserialization, fake-KMS encrypt/
decrypt round trip, verify failure modes), just ceremony-* recipes, README
ceremony + snapshot->merge->apply env procedure, and removal of the stale
AWS_KMS_KEY_ID NodeGuard env var mention (NodeGuard never reads it).
- just ceremony-test-local [endpoint]: runs encrypt -> verify against a
  local AWS emulator's KMS (floci/LocalStack, default localhost:4566)
  using the committed public dev vector, asserting fingerprint ed0210c8
  round-trips. Never touches real AWS; emulator ciphertexts are throwaway.
- Serialize the manifest and env value with UnsafeRelaxedJsonEscaping so
  operators see plain quotes and base64 plus signs instead of u0022/u002B
  unicode escapes. Presentation only: JSON parsers decode both encodings
  identically.
@Jossec101
Jossec101 merged commit 394517f into develop Aug 19, 2026
3 checks passed
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.

2 participants