Six workstreams with acceptance criteria — client-owned segregated subaccounts for regulated onchain repo. Each client subaccount is an onchain margin account owned by a per-subaccount client wallet; the intermediary operates the book as a scoped, non-owning agent.
Locked across every workstream and asserted as binary acceptance gates — a book that violates either one fails acceptance, not review.
B and A ship first (independent, parallelizable), then C, E, and F, with R after A. Migration (F) is done last. Workstream D — repo-module v2 — is referenced as a dependency but is deliberately not specced in this pack.
Solid — hard dependency on A or B · dashed — repo accounts migrate only after D lands · dotted — soft: E's default-facility routing sits on D's beneficial-owner re-keying · R additionally reconciles with B (payout screening) and C (recall before payout), soft
Foundation · ships first, parallel with B · everything else depends on this.
The segregated tier holds each client subaccount as an ERC-721 margin-account NFT owned by a per-subaccount smart-contract wallet, with the intermediary operating the book. This workstream builds that wallet, the identity hierarchy it carries, and the porting controller — the foundation every later workstream depends on. Both locked decisions land here first: the wallet is the sole owner and controller with the intermediary confined to a curated method surface, and segregated-tier rules deploy enforced = true with a deploy-time invariant asserting it.
DesignTrap — CreditFacility is at the EIP-170 contract-size limit, so scoping is structural: the wallet's curated method surface, not new facility bytecode.
| Group | Scenarios | Gate |
|---|---|---|
| Ownership and control | 1 | — |
| Scoped operator (Decision 2) | 3 | Binary gate |
| Identity hierarchy | 3 | — |
| Porting | 1 | — |
| Enforcement (Decision 1) | 1 | Binary gate |
| Regression — existing non-segregated books unaffected | 1 | Must stay green |
Exit screening · ships first, parallel with A · hard prerequisite of migration (F).
Today the facility verifies the sender on an exit, never the recipient — the documented from-only gap; the facility's own NatSpec asks for a recipient-KYC hook that does not exist. This workstream installs a single recipient-KYC compliance rule that gates the recipient of every way value or ownership leaves a segregated account, verifying the required identity claim before the exit is allowed. It is the one gap that blocks porting a client subaccount to a successor intermediary: moving an account is only safe if the party receiving it is verified.
DesignTraps — a rule that gates only transferFrom is silently evaded through either safeTransferFrom overload; and the compliance context drops the transferCollateral destination today, so an operator could move collateral between beneficial owners with zero recipient screening.
| Group | Scenarios | Gate |
|---|---|---|
| Recipient screening on NFT transfer | 2 | — |
| Both safeTransferFrom overloads route through the same gate | 3 | Binary gate |
| withdrawCollateral recipient | 2 | — |
| transferCollateral destination | 2 | Counterparty-resolution gate |
| Liquidation carve-out | 2 | Must never be blocked |
| Enforcement (locked decision) | 2 | Binary gate |
| Regression — books and the liquidation integration path unaffected | 1 | Must stay green |
The core capability · rehypothecation funds intraday credit, per-client bounded · Dennis's north star for the tier.
Rehypothecate a client's margin to fund intraday credit — done the way the survivors of the last crisis did it (Lehman US: per-client bounded, segregation enforced in fact) rather than the way the casualties did (Lehman Europe's unlimited rehypothecation, MF Global's operational misuse). Four deliverables: a vault subclass that reuses collateral only up to a per-client ceiling and never beyond what customers collectively owe; a wrap-versus-raw deposit discipline that decides physically which tokens can ever reach a venue; an intraday credit line whose end-of-day cure is a hard contract invariant; and a pinned enablement order that turns the limit rule on only against a fresh keeper feed.
DesignTraps — the base vault's single aggregate scalar is the Lehman-Europe failure mode; if the tighter per-client caps are not surfaced through the exact views the limit rule reads, the rule keeps enforcing the old aggregate 140% cap and over-limit reuse passes silently; enabling the rule against a stale or zero ceiling would enforce a cap that permits arbitrary reuse; and hook uninstall is swap-and-pop, which silently reorders the chain.
| Group | Scenarios | Gate |
|---|---|---|
| Per-client reuse cap | 4 | — |
| Surfaced through the limit rule's views | 1 | Breakage guard |
| Wrap-versus-raw discipline | 3 | — |
| Intraday credit line and end-of-day cure | 3 | — |
| Enablement order and freshness (Decision 1) | 3 | Binary gates |
| Scoped operator (Decision 2) | 2 | Binary gates |
| Hook install order | 2 | Invariant |
| Regression — base vault byte-identical, prime recipe unchanged | 1 | Must stay green |
Customer reserve · defaulter-pays, bounded by each client's own funded slice.
The segregated tier promises that one client's shortfall can never consume another client's protection — and today it cannot keep that promise on the customer reserve, which is ring-fenced only at the class level and bounds every draw on the aggregate pool balance. A run of disbursements against one client consumes the balance a second client is relying on, even though the second client funded its own slice. The guaranty fund already solves the equivalent problem with a per-member contribution record and defaulter-pays draws; this workstream gives the customer reserve the same per-beneficiary sub-ledger.
DesignTraps — an appended-but-unclassified tier reads as Mutualized (enum value zero): the borrow gate would count ring-fenced customer money as firm capital and under-gate borrowing, and the waterfalls would cross-credit one client's capital to plug another's default — the exact failure this workstream exists to prevent. A prior stale-key defect, where two keys that should have matched silently diverged, motivates the key-alignment check.
| Group | Scenarios | Gate |
|---|---|---|
| Per-beneficiary draw bound (Decision 1) | 3 | Binary gates |
| BeneficiaryScoped tier exclusion (Decision 2) | 5 | Binary gates |
| Default-facility routing | 1 | — |
| Key alignment | 1 | — |
| Prospective segregation | 1 | — |
| Enforcement (enablement hygiene) | 1 | Binary gate |
| Regression — cover signatures unchanged, legacy paths byte-identical | 1 | Must stay green |
Cutover · done last · one account at a time, never against the frozen address book.
Every margin account opened before the segregated tier is owned by the intermediary — a prima facie estate asset in the intermediary's insolvency, with compliance, freeze, and interest all keyed on the intermediary rather than the client. New accounts already open under a ClientMarginWallet (A); this workstream moves the accounts that already exist onto client-owned wallets, one at a time, without ever bricking an account or touching the frozen demo and live address book. The move is a real ERC-721 transfer of the margin-account NFT, gated by the recipient-KYC rule (B) so an account can never land on a non-KYC client.
DesignTrap — the bricked-account trap: migrating before the client wallet is a verified owner would transfer the NFT successfully and then have every controller operation revert on the owner identity check, stranding the account until a rollback. The atomic pre-flight makes owned-but-inoperable unreachable.
| Group | Scenarios | Gate |
|---|---|---|
| Re-owning an existing account | 2 | — |
| Deposit authorizations restored in the same transaction | 1 | — |
| The bricked-account trap (atomic pre-flight) | 2 | Binary gate |
| Rollback | 2 | — |
| Recipient-KYC gate | 1 | Binary gate |
| Repo accounts with open draws | 1 | Gated on D |
| Cutover discipline | 3 | Binary gates |
| Enforcement (locked decision) | 1 | Binary gate |
| Regression — non-migrated books unaffected, frozen address book untouched | 1 | Must stay green |
Venue failure · after A · the authority rotates control, never takes title.
The protocol today has no resolution surface: pause() is a total freeze — every client exit path is gated whenNotPaused — so a paused facility traps even a fully-paid client sitting on excess collateral. That is backwards from a customer-property-first regime: when the venue itself fails, the client's own money should be the first thing that can leave, not the last. This workstream builds the neutral resolution layer — a governed authority, a resolution state machine distinct from pause, an escape hatch that guarantees a solvent client an exit, and a cross-facility migration controller. Every primitive is exercisable by the neutral authority alone.
DesignTraps — resolution is not pause; if the resolution authority could manage the access manager, the neutral resolver would become a single seizer — the payment-system failure mode it exists to prevent; rehypothecated collateral is recalled before the client is paid; and account ids embed the facility, so migration re-mints rather than transfers.
| Group | Scenarios | Gate |
|---|---|---|
| Neutral authority | 3 | Binary gates |
| Resolution state machine (Resolving is not pause) | 3 | Binary gate |
| Escape hatch — resolutionWithdraw | 5 | Binary gates |
| Ownership during resolution | 2 | Binary gates |
| Cross-facility migration | 3 | Binary gates |
| Enforcement (Decision 1 — enablement hygiene) | 1 | Binary gate |
| Regression — books not in resolution unaffected, pause still a total freeze | 1 | Must stay green |
Repo-module v2 makes interest pull from a designated payer and pay to a designated payee, makes rolls tolerant of the scoped operator (both defaulting to the owner), and re-keys the repo default facility on the beneficial owner. It gates repo-account migration — repo accounts with open draws migrate (F) only after D lands — and the reserve default-routing step in E sits on top of its re-keying (soft dependency).