diykey
A Safe signer you build, or try with a passkey

The key ceremony

A key nobody chose, made inside the chip.

How a fresh ATECC608 becomes a diykey key. Its rules are written and locked. Then the chip makes a key that can't be read out, and the key is sealed. Two parts and ten steps, three of them permanent, all on the Cardputer's own screen and keys.

Built, and not yet run on a chip. The ceremony image is on the flash card, beside the signer, and the page checks what it prints. The screens below are that image's own pages, drawn by its code on a laptop, from a rehearsal on a virtual chip (core/examples/ceremony.rs). The steps ran on silicon from the MicroPython signer this one was ported from, on two ATECC608A chips (what ran); this firmware hasn't run them yet. Run a spare chip first.

The keys are now key-c boards, each an ATECC608C behind a USB-C socket. The image refuses a 608C for now: its red page for a revision not tried yet, the key's name and the serial read again before each change are a plan, and their screens are mockups.

  1. ATECC608rules08OTPDKFactoryNothing locked. Its rules are Microchip's.
  2. ATECC608rules08OTPDKP3Rules lockedThe table, checked by CRC.
  3. ATECC608rules08OTPDKP5Data lockedZeros, the record. Slot 0 empty.
  4. ATECC608rules08OTPDKK1Key madeBy the chip's GenKey.
  5. ATECC608rules08OTPDKK3SealedThe key can't change again.

1Prepare the chip

Write the rules, lock them, fill the unused slots with zeros, and lock the data zone. After that, the chip's own rules let nothing write a key into slot 0. Only the chip's GenKey can make one there.

2Make your key

GenKey makes the key inside the chip. Test it, seal it, and work out its Safe signer address. The key never leaves the chip, and there is nothing to write down.

Part 1 makes no key, so it can be done by someone else, and Part 2 still gives a key only you asked for. That makes a branded key possible later. To start with, you run both parts on your own Cardputer.

What you trust, and what you don't

Trusted

The chip

Microchip's silicon makes the key with its own random number generator, and keeps it. An ATECC608 can't prove it is genuine, so buy it from a known seller.

Trusted

The ceremony image you flash

It is the one program that could cheat: before the data lock it could write a key it knows and say GenKey made it. Build it yourself, or compare its SHA-256 with the page's.

Not trusted

The computer

Nothing secret goes over the cable. What goes over USB is the rules, the public key and test signatures.

Not trusted

Whoever ran Part 1

After the data lock the chip refuses to write a key into slot 0, and K1 always makes a new one, whatever was there.

The ceremony doesn't add secure boot. Anyone with the cable could still flash a signer that shows one thing and signs another.

The key: key-c

A 16 × 36 mm board: an ATECC608C behind a USB-C socket, used as wires, not USB. D+ is SDA, D− is SCL, VBUS powers the chip. Five were made at JLCPCB in 2026-10. How it goes on the Cardputer: hardware/.

A 608C

Microchip says it has the 608B's config zone, slots and commands, and the 608B the 608A's, with slightly different command times. This table has run on 608As only, so the first key-c is the rehearsal, through P1's red page.

It unplugs

The Cardputer can't see it go: the Grove port has no pin for CC. So the ceremony reads the serial again right before every write, lock and GenKey, and the signer before every Sign. A different serial stops the step, with nothing written.

Know this

The key alone can sign

The chip signs any digest it's sent. "Only its own hash" is the Cardputer's rule. Whoever holds a key and a microcontroller can make it sign. The Safe's threshold is the protection, and a lost key is swapped out at once.

The counter on its sticker

Counter 0 goes up with every signature and never down. The idle screen shows it. Write it on the key's sticker after the ceremony and after each use: a key that comes back reading more was used without you.

BoardWhat it gets
key-c 1The rehearsal, P1 to K4. Afterwards a working testnet key, and the 608C goes into the plain list.
key-c 2, 3The keys. Owners of a testnet Safe, 2 of 3, with a passkey as the third.
key-c 4The replacement, for the lost-key drill.
key-c 5Kept blank, the spare for the next ceremony image or table.

The lost-key drill

No backup means the Safe's other owners swap a lost key out. The drill shows it works before any key matters: say key-c 3 is lost and put it in a drawer. Key-c 2 and the passkey sign swapOwner, key-c 3 for key-c 4. Then a transaction signed by key-c 3 is refused, and key-c 3's counter still reads what its sticker says. It needs Sign (milestone 3), and a way to send signatures to the Safe.

Part 1

Prepare the chip

Two permanent steps. After them, nothing can write a key into slot 0.

P1 Read the chip: ATECC608A, serial 0123 4a7b 9c2d 5e6f ee. Both zones open, nothing locked yet. Self-test passed. The factory config, sent to the log. Del Back, Enter Write the rules.
P1 Not tried yet, in red, Spare only: Not tried on a 608C yet. Its rules should be a 608A's. Go on only with a spare you can lose. The serial's last four typed, Enter held.
A mockup: a revision no chip has taken through K4 would get a red page first. The image refuses it for now.
P1 refusing a chip: Can't prepare this chip, 0123 f3ac fd2a 826b ee. Its rules were locked before, and they aren't these. Nothing was written. Use a fresh chip.
A used chip is refused, with nothing written. This is the first chip on my bench.

P1No changes

Read the chip

Reads everything. The page saves the factory config to the log.

Checks
It answers at 0x60. Revision 00006002, a 608A; 00006003 (a 608B) and 00006005 (a 608C) are refused for now; the plan is a red page first. Both zones open (55 55), slot locks FF FF. Random gives the fixed pattern of an unlocked chip. SelfTest passes.
Refuses
A used chip, a TrustFLEX or Trust&GO part (they come locked), an unknown revision. It says why.
Then
Write the chip's serial, as the screen groups it, on a sticker on its board.
P2 Write the rules: written and read back, not locked yet. Config CRC 3fb5, in large type. The page works it out too. They should match.

P2Can be written again

Write the rules

Writes the table into the config zone, except the chip's own bytes (0–15 and 84–87), and reads it back.

Checks
The readback is the table. The screen shows the config CRC, and the page works it out on its own from P1's saved bytes. The two should match.
P3 Lock the rules, Permanent, in red. Locks the rules for good. The chip checks CRC 3fb5 first. If one byte differs, it locks nothing. The serial's last four typed: 5 e 6 f, from its sticker. Enter held, the red bar filling.

P3Permanent

Lock the rules

Lock, mode 0x00, with that CRC. The chip works out the CRC of what it holds and refuses if one byte differs. A refused lock locks nothing.

After
Config locked, the table unchanged, Random live.
P4 Its name: A name for this key, key 2 blue typed in a box, 10 of 16. Shown beside its serial. Anyone holding the key can read it. Frozen at P5. Del No name, Enter Next.
P4 Zeros and the record: slots 1 to 15 zeros; the record, into OTP. Data CRC 0c3a. Rewritable until P5 locks it.

P4Can be written again until P5

Zeros and the record

Planned, not in the image yet: first a name for the key, up to 16 characters, or none. Then zeros into slots 1–15, in 32-byte writes: before the data lock, the chip refuses 4-byte writes into secret slots. The record into OTP. The screen shows the data CRC.

Checks
Each write is accepted. P5's CRC checks what they wrote.
The name
Goes into the record and is frozen at P5. The signer shows it beside the serial, so you know which key is in. Anyone holding the key can read it: a colour or a number, not whose it is.
P5 Lock the data, Permanent. Freezes every slot and the record, checked against CRC 0c3a. After this, only the chip's own GenKey can put a key in slot 0. The serial's last four typed, Enter held.

P5Permanent

Lock the data

Lock, mode 0x01, with the CRC of every slot that isn't a key (1–15, in order), then the OTP zone. Again, a single byte off and the chip locks nothing.

After
Data locked. OTP and slot 8 read in the clear; slot 1 can't be read. Slot 0's rules now hold: no Write, no PrivWrite, only GenKey.
P6 Check: Ready for a key. Rules and data locked. Slot 0: empty, not sealed. Counter 0: 0, never used. Enter Make your key.

P6No changes

Check

Reads it all back: both zones locked, the table, the record, counter 0. Slot 0 is checked empty with Info, which doesn't count as a use, so a prepared chip leaves Part 1 with counter 0 at 0.

The keys, and the gate in front of anything permanent

Enter

Does the step, or goes on.

Del

Backs out at any point, with one press. Nothing is written.

A red page

Type the last group of four in the chip's serial, from its sticker, then hold Enter for 3 seconds while a bar fills. Letting go early does nothing.

P3 with two of the four characters typed: 5 e, then two empty boxes. Type all four first.
The screen doesn't show the four. You read them off the chip in your hand, so the spare is never mistaken for the real one.
P3 with all four typed and Enter held: the red bar more than half full.
Then hold Enter. The bar fills over 3 seconds, and only then does the chip get the Lock command.
Part 2

Make your key

One permanent step. Unplug before the seal, and you start again with a new key.

K1 Make your key: Made inside the chip. Nobody chooses it, and it can't be read out or copied. You can make it again until you seal it. Enter Make it.
K1 Your key: P-256, in slot 0, fingerprint 196c 05cd 39d6 3dc1, with its blockie. Made by the chip's GenKey, just now. Slot 1 refuses GenKey. Not sealed yet. Next: test signatures.

K1Can be made again until K3

Make your key

GenKey, mode 0x04, on slot 0. Always, whatever is there: a key you didn't see made is replaced, never used. Reads the public key and shows its fingerprint.

Checks
Slot 0 holds a valid key and its public key reads back. GenKey on slot 1 is refused.
K2 Test it: test signature 1 sent to the page, test signature 2 sent to the page, slot 1 refuses to sign, counter 0 from 1 to 3. Seal it once the page says both are valid.

K2No changes

Test it

Signs two test transactions, each the WebAuthn message over a Safe hash the device works out itself from fixed fields: Base Sepolia, and a Safe address nobody controls, so the signatures can't approve anything. Never a digest from the computer.

Checks
The page checks both with WebCrypto, as it checks a passkey's. Counter 0 went up by exactly the signatures and key reads. Sign on slot 1 is refused.
K3 Seal your key, Permanent. Your key can never be changed or replaced. Lose the chip, and your Safe's other owners swap it out. The serial's last four typed, Enter held, the bar nearly full.

K3Permanent

Seal your key

Lock, mode 0x82: slot 0 alone. From then on the chip refuses GenKey, Write and PrivWrite on that slot. Sign and reading the public key still work.

After
The slot locks read FE FF. The public key is the one K2 tested, and one more signature checks.
K4 Its address: Safe signer address, sealed key, 0x6c46…3f9f with its blockie. A signer, not a wallet: don't send funds here. Funds go to your Safe.

K4No changes

Its address

Works out the Safe signer address from the public key, with its blockie: the address Safe's passkey factory gives this key, the same on every chain. The Cardputer's and the page's should match.

The serial, CRCs, key and address in these pictures are the virtual chip's, from the rehearsal: its key was made by the p256 crate, not a chip.

Afterwards

  1. Flash the signer back. Its idle screen shows the chip; the page shows the key and its address.
  2. Check the address with the passkey factory's getSigner on Base Sepolia, from a block explorer or cast call. This page doesn't: it loads nothing from anywhere else.
  3. Add it as an owner of a testnet Safe, with a threshold you can reach without it, such as 2 of 3 with a passkey and a wallet.
  4. Don't send funds to the address. It only signs.

What to keep

The page saves every line the ceremony prints:

  • the serial, the revision and the factory config
  • the config CRC and the data CRC
  • the public key and the Safe signer address
  • counter 0 after each step, and on the key's sticker
  • the ceremony image's commit and SHA-256

Nothing in it is secret. There is no seed phrase and no backup: lose the chip, and the Safe's other owners swap it out.

The rules: diykey v1

Byte for byte the table the MicroPython signer locked on 2026-10-07. A new table would put new unknowns on a permanent step.

SlotSlotConfig / KeyConfigWhat it is
00x2FA1 / 0x0033Your key. P-256, made by GenKey. External Sign only: no internal sign, no ECDH. Once the data zone is locked, never Write and never PrivWrite. Its public key can be read. Every signature raises counter 0. Lockable: K3 seals it.
80x8F1F / 0x001C416 bytes of plain data, readable once the data zone is locked and never writable after it. Zeros on your own chip; a brand signature on a branded one.
1–7, 9–150x8F9F / 0x001CDead. Data, secret (never readable), never writable after the data lock, not lockable. Zeros.
All 128 bytes
  0: 01 23 00 00 00 00 60 00 00 00 00 00 ee 00 00 00   the chip's own bytes (never written)
 16: c0 00 00 00 a1 2f 9f 8f 9f 8f 9f 8f 9f 8f 9f 8f
 32: 9f 8f 9f 8f 1f 8f 9f 8f 9f 8f 9f 8f 9f 8f 9f 8f
 48: 9f 8f 9f 8f ff ff ff ff 00 00 00 00 ff ff ff ff
 64: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 80: 00 00 00 00 00 00 55 55 ff ff 00 00 00 00 00 00   84-87 are the chip's own too
 96: 33 00 1c 00 1c 00 1c 00 1c 00 1c 00 1c 00 1c 00
112: 1c 00 1c 00 1c 00 1c 00 1c 00 1c 00 1c 00 1c 00
sha256 36da855657a3ee7e098f27cd17b2a636c9e51adec02d252ee0adbe905b8113e1

I2C address 0x60. CountMatch off. A 1.3 s watchdog. Both counters at 0. SecureBoot, KDF, IO protection, UseLock and VolatileKey off. The slot locks start at FF FF: a cleared bit at the config lock would seal slot 0 before it ever had a key.

The record, in OTP

64 bytes, written at P4 and frozen by P5: DK, the layout and table versions, the serial, the revision, the config CRC, the ceremony image's commit, who prepared it (its owner, or a diykey bench), for a branded chip its number and the brand key's id, the board, and the key's name.

It holds no key, because there is no key yet when it's frozen. The signer always reads the live key.

Decisions behind it

  • No PIN. The chip has no lockout: a 6-digit PIN falls in about 7 hours. The Safe's threshold is the protection.
  • A use counter. Every signature raises counter 0, which only goes up. After the data lock a public-key read counts too.
  • Its own firmware image. The write, lock and key commands live in a ceremony image. The signer keeps read commands, plus Sign.
  • The chip says where you are. Each step comes from the chip's state, so a restart resumes.
  • The serial again before every change. A key-c unplugs, and nothing on the Cardputer sees it go.
  • The key alone can sign. The Cardputer holds the rule, not the chip. Not chosen: pairing a key to its Cardputer, whose flash anyone with the cable can read.

In the emulator, the passkey's ceremony

At diykey.app the key is a passkey, and making one is this ceremony, run by your authenticator.

The chipA passkey
The rulesYours, written and locked in Part 1The authenticator maker's
Making the keyK1: GenKey, inside the chip"Make a passkey": inside the Secure Enclave, a TPM or a security key
Testing itK2The page checks every signature
Sealing itK3: the slot lockIt can't be changed, but a synced passkey is copied to your other devices
Its addressK4The key card

Make a passkey in the emulator

An option

A branded key

The project runs Part 1 on a bench. You run Part 2.

Part 1 is where the mistakes happen: a table, two CRCs, two permanent locks and the silicon's quirks. Part 2 is where the key is made. Because Part 1 makes no key, the project could prepare chips on a bench, add a brand, and send them out. Each owner then makes their own key.

  • The bench adds a brand at P4. The record says "a diykey bench" and the chip's number, and slot 8 holds the brand key's signature over the record.
  • Your Cardputer checks it before K1: the signature, under the brand key pinned in the firmware; the serial, revision and config CRC against the chip in front of it; both zones locked, slot 0 not sealed. The check runs on the Cardputer or the page, never on the chip being checked: a fake chip would just say yes.
  • The brand key is diykey key 0000: a Cardputer and a chip through the whole ceremony, its log published. It signs a brand the way the signer signs a transaction: from fields it shows, a digest it works out itself, Sign held. It is never a Safe owner.
The brand picture, a blockie
diykey key 0042 0123 4a7b 9c2d 5e6f ee No key inside yet. Your Cardputer makes it.
Check the brand: diykey key 0042, with the same blockie as the label. Does your label say 0042? Signed by diykey key 0000. Serial and rules: this chip's. Locked, slot 0 empty, unused. Del No, Enter Yes, it matches.
Check the brand, stop: Not a diykey brand. Its signature doesn't verify. Nothing was written. Don't use this chip, and tell the project the number on its label.
What a brand proves

That the project's key signed this serial's record, for this table, and that the chip in front of you has that serial and that table, locked.

What it doesn't

That the silicon is the chip the bench branded. An ATECC608 has no factory certificate, so a fake could copy a real chip's serial, OTP and slot 8. A public list with one claim per serial limits that. Nothing more does.

For the launch, no brand. People who build one buy their own breakout, and the one to trust for Part 1 is themselves. A brand is worth its cost (key 0000's ceremony, a bench image, the check, labels, a public list) when the project hands out chips. Every chip gets slot 8 readable from the start, so a branded chip and your own run the same table.

What has run on silicon

From the MicroPython signer, on a Raspberry Pi Pico 2 W, with Adafruit 4314 breakouts (ATECC608A, revision 00006002). Its code isn't in this repository.

  1. A fresh chip, the whole ceremony in the older order: the key made and sealed before the data lock, slot 8 secret. It settled the CRC's byte order in Lock, the data CRC's layout, that the chip refuses 4-byte writes into secret slots before the data lock and takes 32-byte ones, and that once the data zone is locked, a public-key read counts as a use.
  2. A spare, with this table and in this order: the data lock, then the key, then the seal. GenKey works after the data lock on a slot that never held a key, and slot 8 reads in the clear and is in the data CRC. Refused afterwards, with counter 0 unmoved: GenKey on the sealed slot and on slot 1, Write to slots 0, 1 and 8, to OTP and the config, both zone locks again, Sign and Read on slot 1. A signature from it passed Safe's isValidSignatureForSigner on Base Sepolia; a wrong hash didn't.

Not run yet: a 608C or a 608B

Microchip says both take the same table. The image refuses both for now. Key-c 1 settles the 608C, once P1 has its red page.

Not run yet: the Cardputer

Everything above ran from MicroPython on a Pico. The Rust image's commands, its waits and the chip's power through the AMS1117 are new. A spare settles them.

Left untested: PrivWrite

After the data lock it should be refused. Testing it needs the command, and the signer won't have one.

What it would take

  1. The plan (docs/CEREMONY.md) and these pages.
  2. The write, lock and key commands, in their own file, core/src/ceremony.rs. The signer's atecc.rs keeps read commands only, and the signer's image holds none of the ceremony's code.
  3. A virtual ATECC608 for the tests that refuses what the silicon refused, walked through P1 to K4 with a restart after every step.
  4. The ceremony image: these pages, the serial gate, the hold.
  5. Sign, in the ceremony image, for K2: Nonce and Sign over the WebAuthn digest of a hash the device works out. The signer gets it with milestone 3.
  6. The address on the Cardputer, checked against vectors/webauthn.json.
  7. This site: the ceremony image beside the signer's, with its SHA-256; the log, checked and saved. Not yet: the rehearsal in the browser.
  8. The key-c in the ceremony image: the red page for a 608C, the serial read again before each change, the name.
  9. Key-c 1 through P1 to K4, written up in the build log.
  10. The first real keys: key-c 2 and 3. Then the drill, with key-c 4.

Before you buy

A Cardputer v1.1, two ATECC608 breakouts (one is the spare) or key-c boards, an AMS1117-3.3 module and a Grove cable: the shopping list.

Not the Cardputer-Adv. The v1.1 is being discontinued, and its successor reads its keyboard over I2C on G8, G9 and G11, the pins this firmware drives as outputs. Don't flash the signer on an Adv. And buy a blank chip: TrustFLEX and Trust&GO parts come locked.