Skip to content

feat(identity): add the default multichain identity client - #67

Draft
Wondertan wants to merge 1 commit into
feat/ledger-clientfrom
feat/identity-skeleton
Draft

Wondertan wants to merge 1 commit into
feat/ledger-clientfrom
feat/identity-skeleton

Conversation

@Wondertan

@Wondertan Wondertan commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #64. Starts @libid/identity: libID identities across every ledger a client serves, built on @libid/ledger's multichain client. The ledger package owns the catalog, chain access and the indexer protocol; this package owns the identity registry's meaning.

// Every pinned libID ledger, read through the connected wallet.
const identity = createIdentityClient()

// One list, keyed by ledger objects: an entry for a pinned ledger configures it, any other adds it.
createIdentityClient({
  indexer: 'https://testnet.names.lib.id',
  ledgers: [
    { ledger: Ledgers.EdenTestnet, fee: { amount: 10n ** 15n, recipient } },
    { ledger: anvil, rpc: 'http://127.0.0.1:8545', indexer: false },
  ],
  exclude: [], // pinned ledgers to leave out
})
  • Defaults: with no options, it serves every pinned ledger (Eden testnet and Sepolia today) that has the identity registry (identityRegistry, the IdentityRegistry contract). It reads through the connected wallet and charges no fee. libID pins no RPCs; an entry's rpc enables reads before a wallet connects and lets wallets be offered the chain.
  • Entries:
    • An entry can set rpc and explorer, reach the ledger through another ledger client, replace or turn off the names indexer, and carry that ledger's integrator fee. libID defines no fee.
    • Entries never change a pinned ledger's deployments; the ledger client refuses that.
    • A ledger that is both configured and excluded, or configured twice, is rejected.
  • Validation: fees must be positive, and the recipient is canonicalized. Configured endpoints are validated.
  • Indexer: given by origin, with identity supplying the identityRegistry deployment. On a ledger with one, identity lists come from the indexer or fail; there is no fallback.
  • Client surface: ledgers, ledger(chain), walletRequirements, fee(ledger).

Identity reads, readiness and durable bindings follow in stacked PRs. IdentityError arrives with the first operation that throws one.

Verification

  • pnpm --filter @libid/identity build, typecheck, test: 11 tests pass.
    • The zero-config default, and configuring and adding ledgers from one list.
    • Excluding, delegating to another client, and refusing a changed pinned ledger.
    • Duplicate and conflicting entries.
    • Registry and endpoint requirements, wallet-only ledgers, and fee and indexer validation.
  • Mutation checks, each caught:
    • entries configuring pinned ledgers;
    • entries adding others;
    • exclude;
    • the duplicate guard;
    • the configured-and-excluded guard.
  • Workspace-wide pnpm build, typecheck, test (ledger 104, popup 154, identity 11, ceremony 996), lint, fmt:check and test:packages pass on main at cbe7f35.
  • The package stays private, so the published-package check does not cover it; its build follows the other packages' build-package.ts.

@Wondertan
Wondertan force-pushed the feat/identity-skeleton branch 2 times, most recently from 53dc674 to e63cfd2 Compare September 30, 2026 15:33
@Wondertan Wondertan changed the title feat(identity): add the multichain identity client skeleton feat(identity): add the default multichain identity client Sep 30, 2026
@Wondertan
Wondertan force-pushed the feat/identity-skeleton branch 2 times, most recently from 52c2197 to 92e4a2a Compare September 30, 2026 19:44
@Wondertan
Wondertan added this pull request to stack #68 September 30, 2026 20:04
@Wondertan
Wondertan force-pushed the feat/identity-skeleton branch from 92e4a2a to 2848d87 Compare October 1, 2026 14:08
@Wondertan
Wondertan force-pushed the feat/identity-skeleton branch from 2848d87 to 932c8de Compare October 2, 2026 20:12
@Wondertan
Wondertan removed this pull request from stack #68 October 2, 2026 20:13
@Wondertan
Wondertan added this pull request to stack #107 October 2, 2026 20:13
`createIdentityClient()` serves every pinned libID ledger with the identity
registry, reading through the connected wallet and each ledger's public RPC.
One `ledgers` list, keyed by ledger objects, configures pinned ledgers and adds
others: endpoints, another ledger client, the names indexer, and an integrator
`fee`, which libID never defines. `exclude` leaves pinned ledgers out; entries
never change a pinned ledger's deployments.

Assisted-by: Claude Opus 5.5
Signed-off-by: Wondertan <hlibwondertan@gmail.com>
@Wondertan
Wondertan force-pushed the feat/identity-skeleton branch from 932c8de to 9388e39 Compare October 2, 2026 20:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant