feat(contracts): multisig event registry (#292) + event batch (#293) + DID resolver (#295)#400
Open
Divine-designs wants to merge 1 commit into
Conversation
…atch utility (soroventures#293) + DID resolver (soroventures#295) Three new Soroban contracts added under contracts/, each with its own docs/<name>.md file. soroventures#292 — Contract: Multi-Signature Registry for High-Value Event Emission - New contract `multisig_event_registry`. - M-of-N signer set configured at init; admin can override per-event-type threshold via `set_threshold`. - `propose(event_type, topic2, data)` → returns proposal_id and records the proposer's vote; `approve(proposal_id)` auto-executes once the threshold is met, emitting both the underlying caller-requested event AND a `ms_attest` event with the full signer-approval list for non-repudiation. `cancel(proposal_id)` callable by proposer/admin. - 7 tests cover: threshold-1 instant execution, threshold-2 with second approval, non-signer rejected, double-approve rejected, per-event threshold override, proposer cancellation, init validation. soroventures#293 — Contract: Gas-Optimized Event Batching Utility Contract - New contract `event_batch`. - `emit_batch(sender, entries: Vec<EventEntry>) -> u32` emits up to MAX_BATCH_SIZE (64) events plus a single `batch_emt` summary in one invocation, amortizing dispatch + auth overhead. - `EventEntry { topic, topic2, data: Bytes }` carries type-erased payloads so a single batch can mix event shapes. - 5 tests cover: 2-event batch + summary, dual-topic entry, empty batch rejected, oversized batch rejected, full MAX_BATCH_SIZE batch. soroventures#295 — Contract: Decentralized Identity (DID) Resolver on Soroban - New contract `did_resolver`. - W3C-DID-Core CRUD: register/update/resolve/revoke. DID documents stored as opaque `Bytes` keyed by `String` (intended to be the full `did:soroban:<id>` string). Single controller per DID. - Monotonic `version` counter on update; revoked DIDs resolve to `Some(doc)` with `status = Revoked` rather than `None`, and are non-recyclable. - Every state transition emits a `did_attst` event with `(did, controller, version)` — the event-based identity-verification hook called out in the issue's technical requirements. - 9 tests cover: register+resolve, unknown returns None, double-register rejected, update bumps version + emits identity attestation, non- controller cannot update, revoke still resolves, cannot update after revoke, empty did rejected, multi-update identity attestation stream. Workspace: - All three crates added to contracts/Cargo.toml workspace members. - 21/21 tests pass; release builds clean. - Docs added under docs/ matching the existing per-contract doc style.
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
Three new Soroban contracts added under
contracts/, each with its owndocs/<name>.mdreference doc.Issue #292 — Multi-Signature Registry for High-Value Event Emission
New contract:
contracts/multisig_event_registryinit; admin can override per-event-type threshold viaset_threshold(event_type, threshold).propose(event_type, topic2, data)returnsproposal_idand records the proposer's vote.approve(proposal_id)auto-executes once the threshold is met, emitting both the underlying caller-requested event and ams_attestevent with(proposal_id, event_type, approvals: Vec<Address>)for non-repudiation.cancel(proposal_id)callable by proposer or admin while pending.Issue #293 — Gas-Optimized Event Batching Utility Contract
New contract:
contracts/event_batchemit_batch(sender, entries: Vec<EventEntry>) -> u32emits up toMAX_BATCH_SIZE (64)events plus a singlebatch_emtsummary in one invocation, amortizing dispatch + auth overhead.EventEntry { topic, topic2: Bytes, data: Bytes }is storage-efficient: topics are inline, payload is type-erased so a single batch can mix event shapes.Issue #295 — Decentralized Identity (DID) Resolver on Soroban
New contract:
contracts/did_resolverByteskeyed bydid:soroban:<id>. Single controller per DID. Monotonic version counter on update; revoked DIDs resolve toSome(doc)withstatus = Revoked(notNone) and are non-recyclable.did_attstevent with(did, controller, version)— a verifier can subscribe and react without polling.resolve(did)andstatus(did)read directly from persistent storage.Acceptance Criteria
docs/multisig_event_registry.mddocs/event_batch.mddocs/did_resolver.mdVerification
cargo build -p event-horizon-multisig-event-registry \ -p event-horizon-event-batch \ -p event-horizon-did-resolver # ✅ cargo test -p event-horizon-multisig-event-registry \ -p event-horizon-event-batch \ -p event-horizon-did-resolver # ✅ 21/21 tests passAll three crates added to
contracts/Cargo.tomlworkspace members. Test snapshots are committed alongside the tests.Closes #292
Closes #293
Closes #295