Skip to content

feat(registration)!: transfer selected credentials and issuer attachments - #698

Draft
Dzejkop wants to merge 6 commits into
dzejkop/vault-export-selectionfrom
dzejkop/wip-109-attachments
Draft

Dzejkop wants to merge 6 commits into
dzejkop/vault-export-selectionfrom
dzejkop/wip-109-attachments

Conversation

@Dzejkop

@Dzejkop Dzejkop commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Implements the WIP-109 change in world-id-protocol#1246 for the registration flows. Stacked on #697 (filtered vault export) and includes #683 (reject oversized vaults before insertion), which this replaces.

Draft: the world-id-* crates are pinned by [patch.crates-io] to the branch of world-id-protocol#1268 until it is released.

Changes

  • Requester
    • RegistrationRequester::start takes supported_issuer_schema_ids: Option<Vec<u64>>.
    • Registered gains attachments, released with vault_backup only after on-chain verification.
    • RegistrationResult::attachment_count().
  • Approver
    • supported_issuer_schema_ids() on IncomingRegistration and CheckedRegistration, for building the selection screen.
    • approve takes transfer: Option<CredentialTransfer> (vault plus attachments) instead of vault: Option<Vec<u8>>. None sends neither.
    • Two checks run before anything is submitted and leave the session open: TransferTooLarge (vault plus attachments over 15 MiB; replaces VaultTooLarge) and UnsupportedAttachment (an attachment for an issuer schema the request does not list).
  • Bridge client: reads bodies of up to 22 MiB (was 5 MiB). PUT /response/:id and GET /response/:id get 2 min per request and 5 min per operation; other operations keep 30 s and 1 min.
  • Docs: docs/accounts.md describes selection per issuer schema ID, attachments and the cap.

WalletKit treats attachments as opaque bytes. The host builds the vault with export_vault_for_issuer_schemas, gets attachments from issuer-specific code, and hands received attachments back to that code. WalletKit does not open the vault, so matching attachments to the credentials in it is the host's job.

Breaking

start, approve, Registered and ApproverError change as above, and MAX_VAULT_SIZE becomes MAX_TRANSFER_SIZE. On the wire, this is incompatible with authenticators on world-id 0.25.

Validation

  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings pass.
  • cargo test -p walletkit-core --lib registration: 31 pass. New tests cover the attachment round trip, both pre-insertion errors (no insertion submitted, session stays open), duplicate schema IDs and a 21 MiB bridge read.
  • cargo test -p walletkit-core --test registration_integration passes against staging (with a small attachment; staging-bridge still caps bodies at 5 MiB).
  • Not run: the wasm build, Swift/Kotlin binding generation and cargo deny.

Known gaps

  • A transfer within the cap can still exceed the encoded response limit when attachment framing and format strings use more than the 4 KiB allowance. That is answered with internal_error before insertion, but it ends the session instead of returning TransferTooLarge.
  • The approver still stops uploading at the session expiry. A 20 MiB upload that starts late can be cut off and reported as delivered = false although the authenticator is registered.
  • The requester does not reject attachments for schemas it did not declare; hosts are told to warn and discard.
  • Large transfers need message-bridge#163 deployed with a raised limit.

AI disclosure

Written with Claude Fable 5.2 (Claude Code). Prompt summary: implement the WIP-109 spec change (per-issuer-schema credential selection, issuer attachments, supported issuer schemas, 15 MiB cap) in the registration flows, with pre-insertion size and schema checks and bridge limits sized for the larger response.

🤖 Generated with Claude Code

Dzejkop and others added 5 commits November 18, 2026 14:32
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Read bodies of up to 22 MiB, and give the two operations that carry a
full response a 2 min request timeout and a 5 min operation budget.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ents

Pin world-id-protocol to the WIP-109 attachments revision. The requester
declares its supported issuer schemas, and the approver sends a vault
with the selected credentials plus opaque issuer attachments, capped at
MAX_TRANSFER_SIZE together.

BREAKING CHANGE: RegistrationRequester::start takes
supported_issuer_schema_ids, CheckedRegistration::approve takes an
Option<CredentialTransfer> instead of the vault bytes,
ApproverError::VaultTooLarge is now TransferTooLarge, and MAX_VAULT_SIZE
is replaced by MAX_TRANSFER_SIZE.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…8 head

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

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