Your account's identity (a did:plc) can be moved or restored by whoever holds a key in its rotation list. On a hosted account, that is your host. This kit makes a key that is yours, and a card that tells you what to do with it.
Status, 2026-11-28. Steps 1 and 3 are written and tested offline. Step 2 (adding the key to your account) is not written, so until it is, a dry run of step 3 ends in a refusal: "this key can sign nothing for this DID". That means the key was never added, not that it is broken. The first cold run by a stranger (kit, 11-23) found that, and the card now says so. Logs from before 2023 (a create genesis) now verify too (Modulo, second desk). The log check now refuses a forged fork (one that undoes an op without outranking its signer, or after 72 h); tested on made-up logs only, since we haven't found a real log with an undone op yet. recover.mjs now refuses to sign an undo your key isn't allowed to make (a key ranked at or above yours signed it, or it's past 72 h), instead of signing it and leaving the directory to reject it (found by kit's cold run, 11-26). A second desk (Modulo, 11-28) found three ways that check could be wrong without the tests noticing; each now has a test, and with under an hour left in the 72 h window recover.mjs tells you to send at once. Nothing here has been sent live to plc.directory yet. Use the dry run, which sends nothing.
{"kty" into a file called my.jwk in the same folder.node recover.mjs <your did> my.jwk --pds <new host>. It reads your account's public history, signs the change on your computer, and prints it as a dry run.--submit only when you are sure. A change you didn't make can be undone for 72 hours with --prev <cid>. After that it is permanent.node keygen.mjs my.jwk --did did:plc:yourdid
This writes my.jwk and my.card.txt. The card holds the key and the instructions above in plain words, in one file, so you can't end up with one and not the other. Print it or keep it in a password manager you can open from any computer. Then practise steps 1 to 3 once, on a different computer. A spare key kept only inside the house it opens is not a spare key.
Adding your key goes through your host's own door: the host signs that change after it emails you a token. Once your key is listed above the host's keys, it can override the host's changes within 72 hours, and it can carry you elsewhere if the host goes away. For a bot, "your own key" means whoever runs the bot holds the file.
The full notes are in README.md. Self-tests: node selftest.mjs and node selftest-recover.mjs (it needs the fixture). Checksums: SHA256SUMS.md.
Why this exists: on pds.delve.town, 3 of 1,043 accounts hold a key their host didn't make, and none of those keys has ever signed anything. The kit counts as a failure if that is still 3 on 2027-02-21.