Skip to content

chore(ceremony): preserve the ceremony constructions removed from libid-contracts - #21

Closed
xgreenx wants to merge 1 commit into
mainfrom
preserve/ceremony-constructions-from-contracts
Closed

chore(ceremony): preserve the ceremony constructions removed from libid-contracts#21
xgreenx wants to merge 1 commit into
mainfrom
preserve/ceremony-constructions-from-contracts

Conversation

@xgreenx

@xgreenx xgreenx commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Draft, and deliberately not functional. This does not compile, is not a package, and is not built, tested or published. Do not review it as an implementation — it is a record of code being removed elsewhere, so that the code is not lost.

What this is

These files were moved out of libid-org/libid-contracts#13, where they lived at ts/packages/contracts/src/ceremony/. They are about to be stripped from that PR. This branch is the copy.

1,616 lines, seven files:

file what it implements
authorization.ts ceremony-common §5 Authorization Digest, §7 derived PKCE code_verifier
attestation.ts ceremony-common §9.1 attestation format, plus the coverage, bearer-framing and uniqueness checks
profile.ts pinned platform profiles and protocol parameters, and the GitHub Token-Exchange Service HTTP contract
attestation.test.ts, authorization.test.ts, profile.test.ts 686 lines of tests, passing at the commit they were taken from
index.ts barrel

Why they were removed from libid-contracts

That repository owns the contracts and the TypeScript wrappers around them — typed ABIs, calldata, the concrete types a caller needs to invoke a function. These files are none of those. Nothing here calls a contract, and nothing here is needed in order to call one. It is browser runtime protocol code, which this repository owns.

Removal from libid-contracts is safe because the module has no consumers — nothing in this repo, in handles.link, or in libid-contracts itself imports it. The only tie was a single export * line.

Why it does not compile

profile.ts imports ../identity/handleVectors.js, which is generated in libid-contracts from solidity/contracts/identity/handles.json and does not exist here. That is the only structural break; everything else is self-contained apart from viem and vitest.

There is no package.json, so pnpm -r build|test|typecheck skips the directory entirely and CI stays green. biome lint and biome format both pass over it as-is.

What still has to be decided

Nothing here is settled placement, and this PR is not asking to settle it:

  • @libid/ceremony does not exist yet. Its architecture and module layout are specified in docs(specs): define CCDP and ceremony service contracts #13, which is documentation only and unmerged. When that lands, these files should be reorganized to match it rather than adopted as they stand.
  • profile.ts mixes two things. The pinned platform constants mirror CeremonyProfile.sol in libid-contracts. The token-exchange half — TOKEN_EXCHANGE_ROUTE, the size caps, TokenExchangeRequestV1/ResponseV1 and their validators — is the HTTP contract of a server.
  • That token-exchange contract currently disagrees with docs(specs): define CCDP and ceremony service contracts #13. ts/packages/ceremony/SERVER.md as proposed there specifies POST /api/v1/ceremony/github-token carrying no schema member, while merged specs/platform-ceremonies.md §6.3 fixes /oauth/github/token-exchange with schema: 1. These files implement the merged specification. docs(specs): define CCDP and ceremony service contracts #13's spec diff does not touch §6.3, so as written that PR would merge a SERVER.md contradicting a spec section it leaves standing. Worth resolving before either lands.
  • Cross-implementation agreement is a convention, not a guarantee. The §9.1 fixture is a hex string hand-copied into three repositories — here, CeremonyAttestation.t.sol, and libid-rs/crates/libid-ceremony — with nothing checking the copies match. Generating conformance vectors from one source, the way libid-contracts already generates its handle vectors, would fix that.

Next step

Strip ts/packages/contracts/src/ceremony/** and its src/index.ts export from libid-contracts#13.

🤖 Generated with Claude Code

xgreenx added a commit to libid-org/libid-contracts that referenced this pull request Sep 1, 2026
…ct wrappers

Removes ts/packages/contracts/src/ceremony/ — 1,616 lines across the §5
Authorization Digest, the §7 derived PKCE verifier, the §9.1 attestation codec
with its coverage, framing and uniqueness checks, the platform profiles, and
their 686 lines of tests.

This package owns the contracts and the TypeScript wrappers around them: typed
ABIs, calldata, the concrete types a caller needs to invoke a function. None of
what is removed here is that. Nothing in it calls a contract, and nothing in it
is needed in order to call one — it is browser runtime protocol code, and libid
owns that.

Removal is safe because the module had no consumers. Nothing in this repo, in
libid, or in handles.link imported it; the only tie was one `export *` in
src/index.ts. identity/calls.ts takes `platformId` as a parameter rather than
importing the profile constants, so it is unaffected.

The code is preserved at libid-org/libid#21, a draft that deliberately does not
compile, so nothing is lost by taking it out here. That PR also records what is
still unsettled: @libid/ceremony does not exist yet, profile.ts mixes
contract-mirroring constants with a server HTTP contract, and that contract
currently disagrees with libid#13's SERVER.md.

Also removed alongside the module: the ./ceremony export subpath, the
`export *` in src/index.ts, and the mentions in the package description and in
identity/calls.ts's header. The Solidity under solidity/contracts/ceremony/ is
untouched — those are the contracts, and they stay.

Signed-off-by: xgreenx <xgreenx9999@gmail.com>

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…id-contracts

Not a package and not wired up: no package.json, so `pnpm -r
build|test|typecheck` skips it. It will not compile as it stands.

These 1,616 lines are the only TypeScript implementation of the ceremony wire
constructions that exists anywhere — the §5 Authorization Digest, the §7
derived PKCE verifier, the §9.1 attestation codec and its coverage, framing and
uniqueness checks — and they were about to be deleted from libid-contracts#13,
where they did not belong. This is the copy, so the work survives the removal.

libid-contracts owns the contracts and the TypeScript wrappers around them:
typed ABIs, calldata, the concrete types a caller needs to invoke a function.
None of this is that. Nothing here calls a contract and nothing here is needed
in order to call one; it is browser runtime protocol code, which this
repository owns.

Placement is deliberately left open. @libid/ceremony does not exist yet — its
layout is specified in #13, which is documentation only and unmerged — so these
files should be reorganized against it rather than adopted as they stand.
src/README.md records that, the one import that breaks
(../identity/handleVectors.js, generated in libid-contracts), and two open
questions worth settling before this becomes real code: profile.ts implements
merged specs/platform-ceremonies.md §6.3 while #13's SERVER.md proposes a
different route and drops the schema member, and cross-implementation agreement
is presently a hex fixture hand-copied into three repositories with nothing
checking that the copies match.

Signed-off-by: xgreenx <xgreenx9999@gmail.com>

Assisted-by: Claude Opus 5
@xgreenx
xgreenx force-pushed the preserve/ceremony-constructions-from-contracts branch from 8932fbb to b142897 Compare September 2, 2026 18:22
@xgreenx

xgreenx commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing: the construction this preserves is superseded.

authorization.ts here derives the PKCE verifier as SHA256(PKCE_DOMAIN || authorizationDigest || pkceNonce), under a second nonce beside authorizationNonce. Merged ceremony-common §7 (#20) is SHA256(authorizationDigest || authorizationNonce) with one nonce and no domain, and two live implementations now follow it: ts/packages/ceremony/src/platforms/authorization.ts in #28, and libid-org/libid-contracts#24, which moves the contracts off the old construction. Reorganizing these files into @libid/ceremony as they stand would import a derivation nothing else uses.

The branch preserve/ceremony-constructions-from-contracts is not deleted, so the record this PR existed for survives. The attestation and profile halves are still only here; #28 carries that ground distributed across platforms/{x,github}/1/ rather than as one module.

@xgreenx xgreenx closed this Sep 7, 2026
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