Skip to content

Part 5 — devices and key custody

const devices = await engine.listDevices();
// [{ deviceId, label, createdAt, revokedAt, current }]
// current: true for the device you are asking from

Show this list in your UI. A ghost device — one a malicious relay inserted to wait for a grant — is only detectable if somebody can see it. skm’s defence here is visibility, not mathematics; key transparency is on the roadmap and does not exist yet.

There is nothing to do. A new device registers its public keys on SkmEngine.open, and any device that already holds the keyring grants it during an ordinary sync (autoGrant, on by default).

an existing devicerelaynew deviceregister pubkeys, open graph → status 'waiting'sync → sees the gap → wraps every epoch to N's published pubkeysync → unwraps → status 'ok'

From the app’s point of view: the new device shows waiting until an existing device syncs, then flips to ok. Tell the user that: “open the app on your laptop to finish linking.”

To drive the ceremony yourself, set autoGrant: false and call engine.grantPending(graphId) when you choose.

KeyStore
device:<deviceId> ECDH P-256 keypair — receives wrapped graph keys
sign:<deviceId> ECDSA P-256 keypair — proves authorship
keyring:<graphId> { epochs: {1: key, 2: key}, current: 2 }

Nothing in that list ever leaves the device except public halves.