Guides

Passphrase-protected wallets

Create a wallet

Create a hybrid wallet from an interactive terminal.

Plain text
python -m chain.wallet create .local/wallets/protected
python -m chain.wallet address .local/wallets/protected

Creation asks for a passphrase and confirmation with typing hidden. The command prints the public BKMK address. The address command can show it again without unlocking the wallet. Use a long, unique passphrase.

Sign a transaction

Use the wallet directory with transfer, token-create, token-mint, token-transfer, or reserve-approve. Signing prompts once and unlocks both keys for that operation. You can also sign from the desktop wallet. Existing test wallets created without encryption can continue to sign.

Back up and recover a wallet

  1. Back up the entire wallet directory, including secp256k1.pem, ml-dsa-44.pem, and public.json. Store the passphrase recovery information separately.
  2. Restore the directory to a private location. Run python -m chain.wallet address RESTORED_DIRECTORY and compare the output with your known address.
  3. On a matching local devnet, sign a test payment with the restored wallet to confirm that both keys unlock. Keep the payment file local unless you intend to submit it.

Both private keys and their passphrase are required to spend from an encrypted wallet.

Encryption and sources

OpenSSL stores each key in encrypted PKCS#8 with AES-256-CBC, PBKDF2-HMAC-SHA256, 600,000 iterations, and a separate 16-byte salt. During creation OpenSSL first writes an encrypted staging key under an independent random password, then re-encrypts it under the wallet passphrase. Passphrases go to the OpenSSL subprocess through standard input. The prompt stops if echo-free input is unavailable.

This was tested with OpenSSL 3.5.9, licensed under Apache-2.0, and Python 3.14. OpenSSL PKCS#8 documentation · OpenSSL passphrase input · OpenSSL 3.5.9 license · Python getpass