Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mailbox keys

See Mailboxes for why mail is sealed to your wallet address by default and when a delegated encryption key is needed. This page covers the sithbit mailbox key commands that publish, rotate, read, and clear that optional on-chain key.

mailbox key create

Generates a delegated X25519 keypair client-side and writes it to a file — this does not touch the chain:

sithbit mailbox key create <output path>

mailbox key set

Publishes (or replaces) the delegated key on your mailbox:

sithbit mailbox key set <keypair path> \
  [--keypair <path>] \
  [--skip-preflight]

Arguments

  • <keypair path> (required) — the delegated X25519 keypair file to publish, as generated by mailbox key create.
  • --keypair <path> (optional) — the mailbox owner’s keypair, used to sign the transaction. Defaults to the keypair in your Solana CLI config when omitted.
  • --skip-preflight (optional) — submits the transaction without a local simulation pass first.

Re-running mailbox key set with a fresh keypair file rotates the key: senders start sealing to the new public key immediately, and mail already sealed to the old key still opens with the old key file.

mailbox key get

Reads the published key back, if one exists:

sithbit mailbox key get [owner_address]
  • [owner_address] (optional) — the address whose mailbox to look up. Defaults to your own configured keypair’s address.

Prints the delegated X25519 public key as base58 when one is published, or reports that the mailbox has no delegated key (i.e. mail is sealed to the wallet address).

mailbox key close

Removes the delegated key account and reclaims its rent, returning the mailbox to wallet-sealed mail:

sithbit mailbox key close \
  [--keypair <path>] \
  [--skip-preflight]

Examples

Generate a delegated key, publish it, then confirm it’s live:

sithbit mailbox key create my_delegated_key.json
sithbit mailbox key set my_delegated_key.json --keypair <path to wallet keypair>
sithbit mailbox key get

Rotate to a fresh key:

sithbit mailbox key create my_new_key.json
sithbit mailbox key set my_new_key.json --keypair <path to wallet keypair>

Stop using a delegated key and fall back to wallet-sealed mail:

sithbit mailbox key close --keypair <path to wallet keypair>

See Appendix: How sealed-box encryption works for the full protocol, and Closing accounts for mailbox key close alongside other account-closing commands.