feat(sigild): DB + atomic consume + revocation/audit MVP (CTX-0023) - #31
Merged
Conversation
Implements credential-design.md §4: covers/credentials/credential_consumptions/audit_events (SQLite/WAL, rusqlite bundled)
- atomic consume via UPDATE ... RETURNING in BEGIN IMMEDIATE, with
Idempotency-Key handling (UNIQUE credential_id, idempotency_key)
- verify read-only, revoke, audit trail
- carrier integration via capglyph_core::{framing,ecc} (CBOR seal + Repetition8, K_mac/K_embed HMAC split, soft-bit path)
- axum HTTP: POST /v1/credentials/{verify,consume,revoke}, GET /v1/credentials/{id}
- bin capglyphd (capglyph-server crate) + migrations/001_initial.sql
- concurrent consume no-double-spend tests (max_uses=1/3, idempotent replay, verify readonly, revoked/expired fail-closed)
- cargo fmt/clippy/test/wasm check pass
Closes CTX-0023
Xuepoo
force-pushed
the
ctx-0023/feat-sigild-mvp
branch
from
August 31, 2026 14:15
46bc36b to
7fd2c47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements CTX-0023 — Sigild server MVP: DB + atomic consume + revocation/audit per
docs/research/media-credential/usage/credential-design.md§4.covers / credentials / credential_consumptions / audit_events(Postgres normative, SQLite WAL withrusqlitebundled,migrations/001_initial.sql,SCHEMA_SQLindb.rs)UPDATE ... RETURNINGinsideBEGIN IMMEDIATE+Idempotency-Key(UNIQUE credential_id, idempotency_key),verifyis read-only,revoke+ audit trailcapglyph_core::{framing,ecc}—encode_credential_token/decode_credential_token(CBOR seal + Repetition8, soft-bit LLR path, KMSK_mac/K_embedHMAC split)axum:POST /v1/credentials(issue),/verify,/consume,GET /v1/credentials/{id},POST /v1/credentials/{id}/revoke(headerIdempotency-Key)capglyphd(crates/capglyph-server/src/bin/capglyphd.rs)crates/capglyph-server/README.md+docs/sigild-mvp.mdTests
cargo test -p capglyph-server --test concurrent_consume— 8 tests including concurrent no double-spend (10 threadsmax_uses=1→ 1 success,max_uses=3→ 3, idempotent replay, verify readonly, revoked/expired fail-closed, audit)cargo test --workspace/cargo clippy --workspace --all-targets -- -D warnings/cargo fmt/cargo check --lib --target wasm32-unknown-unknown --no-default-featuresall passcapglyph-serveris a separate crate not incapglyphlib graphHow to test
Closes CTX-0023