Reference

Key rotation

Rotation is how you change who can read new entries. Drop a teammate, replace a partner, or freshen a group on your own cadence. One command does it.

What rotation does

When you rotate a group, the vault generates a new key for that group and hands it only to the readers still on your list. From the next entry onward, anyone you removed sees ciphertext again. Entries written before the rotation stay readable to whoever had access at the time.

When to rotate

A teammate leaves. An API partner changes. A laptop is lost. A quarterly hygiene pass. You do not need a reason, you just need the name of the group.

How rotation works under the hood

A TN log is append-only. Each entry is sealed at write time to the group key that was current at that moment, and the entry is signed so anyone can prove it came from you. Rotation does not rewrite, re-encrypt, or replay the existing log. It mints a fresh group key and binds the next entry to it. The chain of past entries is left exactly as it was.

The mechanism is a key change, not a data change. Each field group carries its own key. When you rotate the payments group, the vault generates a new key for that group, wraps it once per remaining reader against that reader's public identity, and stages those wrapped copies for pickup. Nobody emails a secret. Each reader pulls their own wrapped copy and unwraps it locally with a private key that never leaves their machine.

This gives two distinct access directions, and the distinction is the whole point:

The boundary is the rotation point. Rotation is the single act that drops a reader: the survivors get fresh kits, the dropped reader gets none, and from that entry forward the group is dark to them. There is no separate remove step, and no claw-back of what they already read.

What happens to old log entries when a key rotates?

Nothing. They are not touched. An entry sealed under the previous key remains sealed under that key, and anyone who held that key keeps the ability to open it. This is deliberate. An audit trail that silently became unreadable after a rotation would not be an audit trail. The record an auditor saw last quarter reads the same way this quarter.

Rotation also does not claw back plaintext a reader already decrypted and copied. Once a value has been opened and written somewhere else, it is out of the protocol's reach. Rotation governs who can open new entries, not what a reader has already pulled into their own systems.

The threat model

Two cases drive most rotations: a departed contractor and a compromised partner key. The semantics are the same for both.

A contractor leaves

A contractor had a grant on the payments group for the length of an engagement. The engagement ends. You rotate the group, which hands fresh kits to the survivors and none to the contractor. After the rotation:

A partner key is compromised

Suppose a partner reports that a laptop holding their reader key was lost or that the key leaked. The attacker now holds a key that opens past entries. Rotation contains the blast radius rather than undoing it:

The honest limit

Rotation is a forward-looking control. It bounds future exposure cleanly and verifiably. It does not erase a past disclosure. Treat a compromised key as a disclosure of everything it could already read, then rotate to cap the loss.

A worked example

The payments group has a publisher, a finance teammate, and an outside auditor named Acme. The engagement with Acme ends. To drop Acme, you rotate the group: the survivors get fresh kits, Acme gets none.

# 1. rotate payments so only the survivors get a fresh kit
$ tn rotate payments

# 2. write a new entry, now sealed under the fresh key
$ tn log --event invoice.settled --field invoice_id=inv_5512 --field amount=900.00

Two facts hold after this sequence. The new invoice.settled entry is out of reach for Acme: it was sealed to the fresh key, which was never wrapped for them. Every entry Acme could read during the engagement still opens for them with the older key they already hold. New entries are dark; old grants stand. That is the entire contract.

Verify it

The rotation lands as an attested entry in the same log. Read it back with tn read to confirm the rotation took, and use tn show profiles to inspect the group and its surviving recipients.

The CLI

  1. Add a reader

    Mint a reader kit for a recipient and write their .tnpkg. There is no remove verb. To drop a reader, rotate the group (next step) so the survivors get fresh kits and the departing reader gets none.

    # add a reader to a group
    $ tn add_recipient payments did:key:z6MkPartnerAcme...
  2. Rotate the group

    One command. The vault mints a new group key and emits a fresh .tnpkg kit to every surviving reader. Omit the group name to rotate all non-internal groups at once.

    # rotate the payments group
    $ tn rotate payments
    
    # rotate every non-internal group
    $ tn rotate
  3. Your readers sync

    Each surviving reader picks up their fresh kit on the next tn wallet sync, or installs a delivered .tnpkg with tn absorb. No manual distribution, no email attachments, no chat messages with secrets.

    # on the reader's machine: pick up fresh kits
    $ tn wallet sync
    
    # or install a delivered kit directly
    $ tn absorb payments.tnpkg
  4. Verify (optional)

    The rotation lands as an attested entry. Read it back, and inspect the group's surviving recipients.

    # read the log, including the rotation entry
    $ tn read
    
    # inspect groups and their recipients
    $ tn show profiles

What removed readers see

They can still authenticate to the vault. They can still read entries they already had keys for. What they cannot do is decrypt anything written after the rotation. Their pickup area shows nothing new for this group.

Why auditors care about rotation

Key rotation is not a TN invention. It is a named control in every serious key-management standard, and a rotation log is the kind of evidence an auditor can verify directly.

Because every rotation lands in the same attested log as the entries it governs, the evidence is the record itself. You do not assemble a separate report to show that a key was retired on a given date. tn read reads it back.

Rotate on your own cadence

Rotation is on demand. You rotate when a reader leaves, when a key is suspected of compromise, or on whatever hygiene cadence you set for yourself. There is no built-in scheduler: run tn rotate against a group when you want a fresh key, or tn rotate with no group to refresh every non-internal group at once. Wire it into your own cron or CI if you want it to happen unattended.

# refresh the payments group on demand
$ tn rotate payments

# a periodic hygiene pass over every non-internal group
$ tn rotate
One thing to know

Rotation does not scramble records the removed reader has already decrypted. If you need that, you have to ask them to delete the copies they hold. Rotation is about the future of the log, not the past.

Further reading

On this site:

Standards referenced above:

← Back to the vault