This PR introduces support for exporting and restoring wallet seeds using the codex32 format, enabling non-electronic (paper-based) wallet backups.
To accomplish this, the patch ports the codex32.{c,h}
implementation from Core Lightning to C++, integrating it with Bitcoin Core’s libraries. Corresponding unit tests for codex32 encoding and decoding are also included.
Because Bitcoin Core wallets currently do not store the seed material by default, this PR adds support for doing so, along with a new wallet flag to explicitly indicate when this feature is enabled.
Two new RPCs are introduced:
exposesecret
: exports the wallet seed in codex32 format.
recoverwalletfromseed
: restores a wallet from a codex32-encoded seed.
A functional test included in the last commit demonstrates the full backup and restore flow. Currently, only the default derivation path is supported.
This PR is intended as a proposal for feedback—to assess whether this functionality is desirable, and to explore how it might evolve further.