@thurinlabs/identity-kit 1.3.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,383 +1,78 @@
1
1
  # @thurinlabs/identity-kit
2
2
 
3
- The shared library for Thurin identity — the single source of truth for looking up and **verifying** on-chain identity claims, PGP key proofs, social proofs, and EFP social graph data. It powers both the [thurin.id](https://thurin.id) explorer and the embeddable `ThurinCard`, so a "verified" result means the same thing everywhere.
3
+ The library behind [Thurin.id](https://thurin.id), the Thurin CLI, and the share cards. It reads PGP claims from the PGPRegistry contract, checks them with openpgp.js, and checks the proofs on the key. One core, so "verified" means the same thing everywhere.
4
4
 
5
- Three layers — use whichever fits:
6
-
7
- - **Core** — framework-agnostic functions (verify proofs, parse PGP keys, fetch EFP/claims). No React required.
8
- - **Hooks** — thin React wrappers around the core.
9
- - **ThurinCard** — a drop-in identity card UI built on the hooks.
10
-
11
- A [Thurin Labs](https://thurin.id) project.
12
-
13
- ## Install
5
+ Full reference: [docs.thurin.id/#/sdk](https://docs.thurin.id/#/sdk).
14
6
 
15
7
  ```bash
16
8
  npm install @thurinlabs/identity-kit
17
9
  ```
18
10
 
19
- Peer dependencies: `react`, `react-dom`, `wagmi`, `viem`, `@tanstack/react-query`
20
-
21
- ## Quick Start
22
-
23
- ```tsx
24
- import { IdentityKitProvider, ThurinCard } from '@thurinlabs/identity-kit'
25
- import '@thurinlabs/identity-kit/styles'
26
-
27
- function App() {
28
- return (
29
- <IdentityKitProvider>
30
- <ThurinCard ens="vitalik.eth" theme="thurin" />
31
- </IdentityKitProvider>
32
- )
33
- }
34
- ```
35
-
36
- ## ThurinCard
37
-
38
- A self-contained identity card that fetches and displays all available identity data.
39
-
40
- ```tsx
41
- <ThurinCard ens="vitalik.eth" theme="thurin" />
42
- <ThurinCard address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" theme="dark" />
43
- ```
44
-
45
- **Props:**
46
-
47
- | Prop | Type | Default | Description |
48
- |------|------|---------|-------------|
49
- | `ens` | `string` | — | ENS name to look up |
50
- | `address` | `string` | — | ETH address to look up |
51
- | `theme` | `'thurin' \| 'dark' \| 'light'` | `'thurin'` | Visual theme |
52
-
53
- **Displays:** ENS avatar, name, address, on-chain attestation count, verified proof count, EFP follower count, proof provider badges, and a link to the full [thurin.id](https://thurin.id) profile.
54
-
55
- ## Provider
56
-
57
- Wrap your app (or just the part using identity-kit) in `IdentityKitProvider`. If you already have a `WagmiProvider`, the SDK detects it and uses your existing config.
58
-
59
- ```tsx
60
- // Zero config — public RPC and a public Farcaster node, no keys
61
- <IdentityKitProvider>
62
- <ThurinCard ens="vitalik.eth" />
63
- </IdentityKitProvider>
64
-
65
- // With options
66
- <IdentityKitProvider
67
- rpcUrl="https://your-node.example"
68
- farcasterHub="https://your-farcaster-node.example"
69
- baseUrl="https://thurin.id"
70
- >
71
- <ThurinCard ens="vitalik.eth" />
72
- </IdentityKitProvider>
73
- ```
74
-
75
- | Prop | Type | Default | Description |
76
- |------|------|---------|-------------|
77
- | `rpcUrl` | `string` | publicnode | Ethereum RPC endpoint. Any RPC works — v2 needs only `eth_call` |
78
- | `farcasterHub` | `string` | Hypersnap public node | A Farcaster node's HTTP API for Farcaster proofs. The default, Quilibrium's `haatz.quilibrium.com`, needs no key; it sees the visitor's IP and which account was checked (1.3.7) |
79
- | `neynarApiKey` | `string` | — | Optional: read Farcaster through Neynar's hub instead. Not needed since 1.3.7 |
80
- | `baseUrl` | `string` | `https://thurin.id` | Base URL for "View on Thurin" links |
81
- | `network` | `'mainnet' \| 'sepolia' \| 'local'` | `'mainnet'` | Which chain to read the PGPRegistry on (`local` = a running anvil) |
82
- | `registryAddress` | `string` | v2 address | Override the registry contract address |
83
-
84
- ## Hooks
85
-
86
- For custom UI, use the hooks directly instead of `ThurinCard`.
87
-
88
- ### useThurinIdentity
89
-
90
- Combined identity data — ENS, on-chain attestations, PGP proofs, and EFP social graph.
91
-
92
- ```tsx
93
- const identity = useThurinIdentity('vitalik.eth')
94
- // or
95
- const identity = useThurinIdentity('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
96
- ```
97
-
98
- Returns: `ThurinIdentity` with `address`, `ensName`, `ensAvatar`, `claims`, `totalClaims`, `activeClaims`, `currentFingerprint`, `pgpKeyInfo`, `proofs`, `efp`, `isLoading`, `error`.
99
-
100
- When the identity can't be shown, `error` is a plain `Error` safe to display and `errorKind` says why: `'rpc'` (the RPC didn't answer, so nothing is known), `'not-found'` (the ENS name has no address), or `'read'` (the RPC answers but a registry read failed); `retry()` re-runs the lookups. `ThurinCard` shows these instead of zeros, and a follower count EFP didn't answer for shows `–` (1.3.4).
101
-
102
- `ensAvatar` is set only when loading it can't reveal the viewer to the name's owner: IPFS, Arweave, inline data, a content-addressed NFT, or `euc.li` (the ENS app's upload host). IPFS images load through `ipfs.filebase.io`, falling back to Pinata's public gateway if that fails (`IPFS_GATEWAYS`, `avatarFallbacks()`; 1.3.6). A plain `https://` avatar on the owner's own server is left out, since loading it would hand that server every viewer's IP (1.3.3; earlier versions loaded any avatar). The rule is `avatarUrl()` in the core; `useSafeAvatar(name, chainId)` is the hook.
103
-
104
- ### useAttestations
105
-
106
- On-chain attestation data from the PGPRegistry v2 contract — the owner's history plus the stored signature and key for each claim, read with plain contract calls (no event logs), each verified off-chain.
107
-
108
- ```tsx
109
- const { claims, totalClaims, activeClaims, currentFingerprint, isLoading } =
110
- useAttestations('0xd8dA...')
111
- // claims[].{ index, fingerprint, createdAt, revoked, revokedAt, messageVersion, pgpSignature, pgpPublicKey, verification }
112
- ```
113
-
114
- ### useEFPGraph
115
-
116
- EFP (Ethereum Follow Protocol) social graph data.
117
-
118
- ```tsx
119
- const { efp, isLoading } = useEFPGraph('0xd8dA...')
120
- // efp.followers, efp.following, efp.top8, efp.hasEfp
121
- ```
122
-
123
- ### usePGPProofs
124
-
125
- PGP key info and verified social proofs, read from the key stored in the identity's on-chain attestation. No keyserver is consulted.
126
-
127
- ```tsx
128
- const { keyInfo, proofs, isLoading } = usePGPProofs(fingerprint, attestation.pgpPublicKey)
129
- // proofs[].provider, proofs[].status, proofs[].displayUrl
130
- ```
131
-
132
- `useThurinIdentity` wires this up for you from the current attestation.
133
-
134
- ### useEnsHint
135
-
136
- ```tsx
137
- const { state, record, reason, isLoading } = useEnsHint('ben.thurinlabs.eth', identity.currentFingerprint)
138
- ```
139
-
140
- The name's `id.thurin` text record against the key the registry verifies for its address. `state` is `match`, `unset`, or `mismatch` (with a `reason`). The record is a discovery hint an ENS profile can show; the trust is in the claim. See [Point your ENS name at your claim](https://docs.thurin.id/#/guides/ens-record).
141
-
142
- ### useRecords
143
-
144
- ```tsx
145
- const { records, isLoading } = useRecords(identity.address, claimIndex)
146
- // records: [{ kind: 'thurin.railgun', text, valid, data: { type: 'railgun', address } }, ...]
147
- ```
148
-
149
- The records on one claim for the kinds an identity page shows (`IDENTITY_KINDS`), read in one multicall and parsed. Kinds with no record are left out. See the [records reference](https://docs.thurin.id/#/records).
150
-
151
- ## `@thurinlabs/identity-kit/core` — no React
11
+ Runs in Node, workers, and browsers. The only peer dependency is `viem`. `@thurinlabs/identity-kit/core` is the same entry, for older imports.
152
12
 
153
- Everything under "Core utilities" below is also published as its own entry point with no React, wagmi, or DOM dependency, for Node and worker consumers (the Thurin CLI and the share-card service use it):
13
+ ## Read an address
154
14
 
155
15
  ```ts
156
- import { verifyAttestation, parsePgpKey, getRegistry, chainFor } from '@thurinlabs/identity-kit/core'
157
- ```
158
-
159
- Runtime dependencies of this entry: `openpgp` (bundled dependency), `viem` (peer), and in Node `eckey-utils` (dependency) for secp256k1 keys.
160
-
161
- ## Core utilities (no React)
162
-
163
- The verification and data logic is exported as plain functions — no React, no provider. This is the layer the thurin.id explorer and the hooks both build on; use it directly when you need the validated data behind your own UI.
16
+ import { createPublicClient, http } from 'viem'
17
+ import { mainnet } from 'viem/chains'
18
+ import { readClaims, keyStanding, claimCheckText } from '@thurinlabs/identity-kit'
164
19
 
165
- ### Proofs
20
+ const client = createPublicClient({ chain: mainnet, transport: http('https://ethereum.publicnode.com'), batch: { multicall: true } })
166
21
 
167
- ```ts
168
- import { identifyProof, verifyProof, displayUrl, proofHref, proofSecondaryHref } from '@thurinlabs/identity-kit'
169
-
170
- const proof = identifyProof({ name: 'proof@thurin.id', value: 'https://gist.github.com/alice/abc123' })
171
- // → { provider: 'github', label: 'GitHub', user: 'alice', gistId: 'abc123', url }
172
-
173
- const result = await verifyProof(proof, fingerprint) // options: { farcasterHub?, neynarApiKey? }
174
- // → { verified: boolean, reason?: string }
22
+ const claims = await readClaims(client, '0x539C7e1E454296Dc150B95a0acCC05bCa3b33538')
23
+ const { kind, claim } = keyStanding(claims)
24
+ // kind: verified · not-counted (active claims, none verify) · inactive (only ended claims) · none
25
+ if (kind === 'verified') console.log(claim.fingerprint, claim.pgpPublicKey)
26
+ if (kind === 'not-counted' && claim.verification) console.log(claimCheckText(claim.verification).label)
175
27
  ```
176
28
 
177
- `verifyProof` performs the real check per provider — including confirming the GitHub gist is **owned** by the claimed user, so a proof can't be forged by pointing at someone else's gist ID. `displayUrl` / `proofHref` / `proofSecondaryHref` build the display string and links.
29
+ `readClaims` returns every claim, oldest first, and reads and verifies the newest 50 (`{ limit }` changes that; older ones come back with `verification: null`). `keyStanding` picks the newest active claim that verifies. `findOwners(client, { fingerprint })` or `{ keyId }` goes the other way: every address that ever claimed a key. ENS is left to you: resolve the name with viem first. `batch: { multicall: true }` makes the reads one request.
178
30
 
179
- ### PGP
180
-
181
- ```ts
182
- import { parsePgpKey, verifyAttestation, stripEmailUserIDs, hasEmailUserID } from '@thurinlabs/identity-kit'
183
-
184
- const keyInfo = await parsePgpKey(armoredKey)
185
- // → { fingerprint, userIDs, algorithm, created, expires, notations, subkeys } | null
186
-
187
- const verification = await verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress })
188
- // → { verified: boolean, reason?: string }
189
-
190
- // Prepare a key for publishing: drop every user ID that contains an email address.
191
- const stripped = await stripEmailUserIDs(armoredKey)
192
- // → { armored, kept: ['thurin'], removed: ['Alice <alice@example.com>'] } | null (null = nothing would remain)
193
-
194
- await hasEmailUserID(armoredKey) // → true if any user ID contains an @
195
- ```
196
-
197
- **Published identity.** An attestation stores the armored key on-chain, permanently and publicly. Since 0.9.0 the intended shape is a key whose only user ID is a non-email one (any name — `thurin` is the suggestion), carrying the `proof@thurin.id` notations. `stripEmailUserIDs` produces that from a normal export; the stripped key still verifies (`verifyAttestation` needs at least one self-certified user ID, so a key with none is rejected) and keeps the notations on the user ID it retains. Proofs are then read from the on-chain key, never from a keyserver.
198
-
199
- Nothing in the kit talks to a keyserver: keys come from the registry, and `thurin keyserver` / keys.thurin.id serve them over HKP for gpg.
200
-
201
- ### EFP & claims
202
-
203
- ```ts
204
- import { fetchEFPGraph } from '@thurinlabs/identity-kit'
205
-
206
- const graph = await fetchEFPGraph(address)
207
- // → { followers, following, top8: string[], hasEfp } | null
208
- ```
209
-
210
- ### Contract
211
-
212
- ```ts
213
- import { REGISTRY_ADDRESS, REGISTRY_ABI, NETWORKS, getRegistry } from '@thurinlabs/identity-kit'
214
-
215
- getRegistry('sepolia') // → { chainId: 11155111, address, deployBlock, explorerUrl, defaultRpcUrl }
216
- ```
217
-
218
- `REGISTRY_ABI` is the complete v2 ABI (reads and writes), so apps that publish claims use the same one. The v2 registry is deployed with CREATE2 and has the same address on every network.
219
-
220
- ### Records
221
-
222
- ```ts
223
- import { fetchRecords, parseRecord, encodeRecord, kindName, IDENTITY_KINDS, KNOWN_KINDS } from '@thurinlabs/identity-kit/core'
224
-
225
- const records = await fetchRecords(publicClient, REGISTRY_ADDRESS, REGISTRY_ABI, owner, claimIndex) // ParsedRecord[] for IDENTITY_KINDS
226
- const one = await parseRecord('thurin.canary', text) // { valid, reason?, data: { type: 'canary', date, statement, clearsigned } }
227
- ```
228
-
229
- A record is one value per claim per kind, up to 1 KB, set only by the owner. `parseRecord` never throws: a value that does not fit its kind comes back with `valid: false` and a reason. Kinds Thurin defines: `thurin.railgun`, `thurin.security`, `thurin.successor`, `thurin.affiliation`, `thurin.canary`, `thurin.private`, `thurin.disclosure` (shown on identity pages) and `thurin.pointer` (the Thurin Labs release list). Anyone can use reverse-dot names of their own.
230
-
231
- ### ENS record (`id.thurin`)
232
-
233
- ```ts
234
- import { ensHintFor, ensHintValue, ensHintWrite, fetchEnsHint, ENS_HINT_KEY } from '@thurinlabs/identity-kit/core'
235
-
236
- const hint = await fetchEnsHint(publicClient, 'ben.thurinlabs.eth', verifiedFingerprint) // { state: 'match' | 'unset' | 'mismatch', record, fingerprint, expected, reason? }
237
- const call = ensHintWrite('ben.thurinlabs.eth', verifiedFingerprint) // { abi, functionName: 'setText', args: [namehash, 'id.thurin', 'FPR…'] }
238
- const resolver = await publicClient.getEnsResolver({ name: call.name }) // look it up at write time; ENSv2 resolvers are per account
239
- ```
240
-
241
- `ensHintFor(record, fingerprint)` is the pure comparison; `ensHintValue` is the bare uppercase form Thurin writes.
242
-
243
- ### Avatars
244
-
245
- ```ts
246
- import { avatarUrl, parseNftAvatar, nftAvatarImage } from '@thurinlabs/identity-kit/core'
247
-
248
- avatarUrl('ipfs://Qm…') // 'https://ipfs.filebase.io/ipfs/Qm…' (avatarFallbacks() → Pinata)
249
- avatarUrl('https://euc.li/vitalik.eth') // allowed: ENS Labs' host, not the owner's
250
- avatarUrl('https://example.com/me.png') // null: the owner's server would see every viewer
251
- ```
252
-
253
- ### Fingerprints and key IDs
254
-
255
- The v2 registry takes raw fingerprint bytes and indexes by their hash and by long key ID:
256
-
257
- ```ts
258
- import { fingerprintToBytes, bytesToFingerprint, fingerprintHash, keyIdOf, keyIdToBytes } from '@thurinlabs/identity-kit'
259
-
260
- fingerprintToBytes('6E00 5391 … 7FE7') // → '0x6e0053911942a889426c1866e34d9266098f7fe7' (attest / reattest arg)
261
- bytesToFingerprint('0x6e00…7fe7') // → '6e0053911942a889426c1866e34d9266098f7fe7'
262
- fingerprintHash(fp) // → keccak256 of the raw bytes (addressesFor arg)
263
- keyIdOf(fp) // → '0xe34d9266098f7fe7' (fingerprintsForKeyId arg; v4 = last 8 bytes, v6 = first 8, per RFC 9580)
264
- ```
265
-
266
- ### Authorized writes (EIP-712)
267
-
268
- Every write has a `…For` twin that anyone can submit with the owner's signature — for cold wallets, a CLI, or a sponsor. The helpers build exactly the typed data the contract verifies:
269
-
270
- ```ts
271
- import { attestTypedData, authorizationDigest } from '@thurinlabs/identity-kit'
272
- import { signTypedData } from '@wagmi/core'
273
-
274
- const nonce = await readContract({ ..., functionName: 'nonces', args: [owner] })
275
- const typedData = attestTypedData(chainId, registryAddress, {
276
- owner, fingerprint, pgpSignature, pgpPublicKey, nonce, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600),
277
- })
278
- const signature = await signTypedData(config, typedData)
279
- // anyone: attestFor(owner, fingerprintBytes, sigBytes, keyBytes, deadline, signature)
280
- ```
281
-
282
- Also `reattestTypedData`, `updateKeyTypedData`, `revokeTypedData`, `setRecordTypedData`, and `recordKind(name)` for the `bytes32 kind` of a record.
283
-
284
- ## Themes
285
-
286
- Three built-in themes: `thurin`, `dark`, `light`. All styles are scoped under `[data-thurin-theme]` with `thurin-` prefixed class names to avoid conflicts with your app's styles.
287
-
288
- Import styles when using `ThurinCard`:
31
+ In React, wrap it in whatever you use for data, for example:
289
32
 
290
33
  ```tsx
291
- import '@thurinlabs/identity-kit/styles'
34
+ const { data: claims } = useQuery({ queryKey: ['claims', address], queryFn: () => readClaims(client, address) })
292
35
  ```
293
36
 
294
- Hooks-only consumers don't need to import styles.
295
-
296
- ## Embed (No React Required)
297
-
298
- For static sites, Jekyll blogs, WordPress, or any HTML page — use the standalone embed script. Everything runs client-side; there's no Thurin backend in the path.
299
-
300
- ```html
301
- <div
302
- data-thurin-card="bendoubleu.eth"
303
- data-theme="thurin"
304
- data-rpc-url="https://your-node.example"
305
- ></div>
37
+ `verifyAttestation` checks that the key has the claimed fingerprint, that the signature is over exactly `I control the Ethereum address: <lowercase address>`, and that the key is valid today, as gpg judges it. When a claim doesn't count, `kind` says why (`expired`, `revoked`, `compromised`, `unsupported`, `bad-signature`, …) and `claimCheckText` turns it into words.
306
38
 
307
- <script src="https://cdn.jsdelivr.net/npm/@thurinlabs/identity-kit@0/dist/embed.global.js"></script>
308
- ```
309
-
310
- | Attribute | Description |
311
- |-----------|-------------|
312
- | `data-thurin-card` | ENS name or ETH address to look up (required) |
313
- | `data-theme` | `thurin`, `dark`, or `light` (default: `thurin`). Change it after render and the card follows, so a page with a theme switch can keep the card in step. |
314
- | `data-rpc-url` | Optional. Any Ethereum RPC; the card reads the v2 registry with plain calls, so the keyless public default works. |
315
- | `data-farcaster-hub` | Optional. A Farcaster node for Farcaster proofs; the default is a public node that needs no key. |
316
- | `data-neynar-key` | Optional. Read Farcaster through Neynar with your key instead (not needed since 1.3.7). |
317
- | `data-base-url` | Optional. Where the card's "View on Thurin" link points (default `https://thurin.id`). A page served from ENS can pass its own name so the link stays on ENS. |
318
- | `data-network` | Optional. `sepolia` or `local` instead of mainnet. |
319
- | `data-registry-address` | Optional. Override the registry contract address. |
39
+ `REGISTRY_ADDRESS` is `0xFa6956c11163517249f8A67F5560a4406B519451`, the same on Ethereum mainnet and Sepolia; `getRegistry(network)` gives each network's chain id, explorer, and default RPC. `REGISTRY_ABI` is the whole contract, writes included.
320
40
 
321
- The card talks directly to Ethereum and each proof platform — no intermediary, no keyserver. Cards render automatically on page load and for dynamically added elements.
41
+ **Is a key compromised?** Ask the contract: `keyStatus(owner, fingerprint)`. Don't read it off the newest claim, and never count "compromised" across owners: anyone can claim any fingerprint and mark it under their own address.
322
42
 
323
- ## Supported Proof Providers
43
+ The rest, all covered in the [docs](https://docs.thurin.id/#/sdk):
324
44
 
325
- | Provider | Proof Method |
326
- |----------|-------------|
327
- | GitHub | Public gist, or a repository description (the form an organisation can use) |
328
- | DNS | TXT record |
329
- | Farcaster | Public cast (read from a public Farcaster node; no key) |
330
- | Codeberg | Repository description |
331
- | Mastodon | Profile metadata |
45
+ - **Proofs:** `identifyProof`, `verifyProof` (GitHub, DNS, Farcaster, Codeberg, Mastodon; a GitHub or Codeberg proof must belong to the account in its URL).
46
+ - **Claim history:** `claimFates`, `claimFateText`, `expiresSoon`, `expiresSoonText`.
47
+ - **Records:** `kindName`, `checkKindName`, `checkRecordValue`, `fetchRecords`, `pickRecords`, `pageRecords`, `parseRecord`, and the `thurin.releases` helpers.
48
+ - **Permissions:** `attestTypedData`, `reattestTypedData`, `updateKeyTypedData`, `revokeTypedData`, `setRecordTypedData`, `markCompromisedTypedData`, for the registry's `…For` writes. To mark an already revoked claim compromised, sign `markCompromisedTypedData` alone.
49
+ - **Keys:** `parsePgpKey`, `leanKey`, `claimSignature`, `sshKeys` (SSH keys as `authorized_keys` lines), `stripEmailUserIDs`, fingerprint and key-ID helpers.
50
+ - **Encrypt:** `encryptionKeyFor` (only the claim that counts, with a valid encryption subkey; says when the key arrived in the last 7 days), `encryptTo` (hides the recipient by default), `encryptRefusalText`, `keyChangedText`.
51
+ - **ENS:** `fetchEnsHint`, `ensHintWrite` for the `id.thurin` record.
52
+ - **Avatars:** `avatarUrl`, `avatarFallbacks`, only from places that can't see the viewer: IPFS, Arweave, inline data, a content-addressed NFT, or `euc.li`.
332
53
 
333
- ## How a claim is verified
54
+ ## A card for your README
334
55
 
335
- `verifyAttestation` checks three things: the stored key's fingerprint is the one on the claim; the stored clearsigned statement was made by that key (or one of its bound signing subkeys) and has not been altered; and the statement names the claim's address. Key validity is judged **now**, the way gpg does it: the key must currently be bound, unrevoked, and unexpired. It is deliberately not judged at the instant the signature was made, which is openpgp.js's default. That default rejects a perfectly good claim whenever the key's newest self-certification postdates the attest signature, which is exactly what happens when you add a proof after attesting and export with `export-minimal` (1.0.3).
56
+ No library needed: thurin.id draws an image of any identity (name, key, and whether it's verified), `https://thurin.id/card/ens/<name>.png`. See [the docs](https://docs.thurin.id/#/sdk?id=readme-card).
336
57
 
337
58
  ## Key algorithms
338
59
 
339
- Any curve openpgp.js can compute is accepted: Ed25519, Cv25519, NIST P-256/384/521, brainpool, RSA, and **secp256k1**. openpgp.js rejects secp256k1 by default because RFC 9580 does not list it; identity-kit removes secp256k1 from `rejectCurves` and leaves the rest of the list alone, since that one entry is a compatibility rule, not a security one (1.3.2; earlier versions cleared the whole set). A secp256k1 PGP key doubles as an Ethereum key (the address is derived from the same public point), so anything that can sign with the PGP key can sign Ethereum transactions: hold such a key if you like, but do not fund its derived address. In Node, openpgp.js needs the `eckey-utils` package for this curve; identity-kit depends on it, so `npm install` brings it in. The browser build needs nothing extra.
340
-
341
- ## Migrating from 0.9.x
342
-
343
- 1.0.0 reads the **PGPRegistry v2** contract. The v1 registry is no longer read.
60
+ Anything openpgp.js can verify: Ed25519, Cv25519, NIST P-256/384/521, brainpool, RSA, and secp256k1, which openpgp.js refuses by default and the kit allows. A secp256k1 PGP key is also an Ethereum key, so don't fund its address. In Node, secp256k1 needs `eckey-utils`, which the kit installs.
344
61
 
345
- | 0.9.x | 1.0.0 |
346
- |-------|-------|
347
- | `REGISTRY_ABI` (v1, reads only) | v2 ABI, reads + writes |
348
- | `CONTRACT_DEPLOY_BLOCK` | removed (no log scans) |
349
- | `Attestation.txHash` | removed; `revokedAt` and `messageVersion` added |
350
- | `rpcUrl` needed `eth_getLogs` | any RPC |
351
- | — | `local` network, `registryAddress` prop / `data-registry-address` |
352
- | — | fingerprint helpers, EIP-712 authorization helpers |
62
+ ## Upgrading from 1.x
353
63
 
354
- ## Migrating from 0.8.x
64
+ 2.0.0 reads PGPRegistry v3. Claims store the key and signature as raw bytes.
355
65
 
356
- 0.9.0 moves proofs to the on-chain key and adds key-preparation helpers.
357
-
358
- | 0.8.x | 0.9.0 |
359
- |-------|-------|
360
- | `usePGPProofs(fingerprint)` — fetched the key from keys.openpgp.org | `usePGPProofs(fingerprint, armoredKey)` — parses the supplied (on-chain) key |
361
- | — | `stripEmailUserIDs(armoredKey)`, `hasEmailUserID(armoredKey)` |
362
- | mainnet only | `network` prop / `data-network` attribute; `NETWORKS`, `getRegistry()` |
363
-
364
- `useThurinIdentity`, `ThurinCard`, and the embed need no changes; they pass the attestation's key through automatically.
365
-
366
- ## Migrating from 0.7.x
367
-
368
- 0.8.0 collapses the Scry / Signet sub-brands into Thurin. Renames only — no behaviour changed, and existing on-chain attestations verify exactly as before.
369
-
370
- | 0.7.x | 0.8.0 |
371
- |-------|-------|
372
- | `ScryCard` / `ScryCardProps` | `ThurinCard` / `ThurinCardProps` |
373
- | `useScryIdentity` | `useThurinIdentity` |
374
- | `useSignetClaims` | `useAttestations` |
375
- | `ScryIdentity` (type) | `ThurinIdentity` |
376
- | `SignetClaim` (type) | `Attestation` |
377
- | `scryBaseUrl` (provider prop) | `baseUrl` |
378
- | `data-scry-card` (embed) | `data-thurin-card` |
379
- | `[data-scry-theme]`, `.scry-*`, `--scry-*` | `[data-thurin-theme]`, `.thurin-*`, `--thurin-*` |
380
- | `ScryEmbed` (IIFE global) | `ThurinEmbed` |
66
+ | 1.x | 2.0.0 |
67
+ |---|---|
68
+ | `attestationsOf`, `getPayload` | `claimsOf`, `keyBytes`, `signatureBytes`; `readClaims` does it for you |
69
+ | `Attestation` | adds `state`, `replacedBy`, `revokeReason`; `messageVersion` 1 = detached, 0 = clearsigned |
70
+ | typed data `pgpSignature`, `pgpPublicKey` | `signature`, `key`; `Reattest` adds `keepRecords`, `Revoke` adds `reason`, `SetRecord` takes text; new `MarkCompromised` |
71
+ | `encodeRecord`, `decodeRecord`, `bytes32` kinds | text records listed by `recordsOf`; `checkKindName`, `checkRecordValue` |
72
+ | `RegistryDeployment.deployBlock` | removed |
73
+ | `IdentityKitProvider` and the hooks (`useThurinIdentity`, `useAttestations`, …) | removed; `readClaims`, `keyStanding`, `findOwners` in any framework |
74
+ | `ThurinCard`, the embed script, `/styles`, `Theme`, the `baseUrl` prop | removed; use the [card image](https://docs.thurin.id/#/sdk?id=readme-card) |
75
+ | a statement containing the address verified | the signed text must be exactly the statement |
381
76
 
382
77
  ## Development
383
78
 
@@ -387,14 +82,4 @@ npm run build
387
82
  npm test
388
83
  ```
389
84
 
390
- ## Links
391
-
392
- - [Thurin](https://thurin.id) — Identity explorer
393
- - [Attest](https://thurin.id/attest) — Create identity claims
394
- - [Documentation](https://docs.thurin.id)
395
- - [GitHub](https://github.com/thurinlabs/identity-kit)
396
- - [Codeberg](https://codeberg.org/thurinlabs/identity-kit)
397
-
398
- ## License
399
-
400
- MIT
85
+ [GitHub](https://github.com/thurinlabs/identity-kit) · [Codeberg](https://codeberg.org/thurinlabs/identity-kit) · MIT