Skip to content

design-doc: compliance module (Chainalysis-backed ICompliance) - #380

Open
tynes wants to merge 4 commits into
mainfrom
compliance-module-2
Open

design-doc: compliance module (Chainalysis-backed ICompliance)#380
tynes wants to merge 4 commits into
mainfrom
compliance-module-2

Conversation

@tynes

@tynes tynes commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds protocol/compliance-module.md: an optional, opt-in compliance screening layer for OptimismPortal2 (deposits) and L2ToL1MessagePasser (withdrawals). The bridges call a single ICompliance.check(from, to) hook; one concrete implementation, ChainalysisCompliance, wraps the on-chain Chainalysis Sanctions Oracle.
  • Adds security/fma-compliance.md: the failure mode and recovery analysis for the module.
  • ETH msg.value on screened-out transactions (sanctioned addresses or oracle outages) is permanently locked in the compliance contract — the contract has no admin role and no ETH-egress function. Two alternative dispositions (auto-bounce-to-sender, burn-to-address(0)) are documented in the Alternatives section.

Design highlights

  • Single minimal interface. ICompliance.check(address,address) returns (bool) is the only function the bridges depend on. The 4-byte selector is preserved indefinitely; richer signatures will be added as overloads in future iterations rather than by replacing this one.
  • No state machine, no plugins, no admin. Earlier drafts proposed an abstract Compliance + L1Compliance + L2Compliance split, an IRule plugin set, a four-state status enum with bit-packed owner-override, and a settle / approved callback flow. All of that is gone. The deployed ChainalysisCompliance has no Ownable, no recover, no settle, no transferOwnership.
  • Hot-path behavior. Compliant: oracle says clean → donateETH back to bridge → bridge proceeds. Sanctioned or oracle-failure: ETH retained, distinct event emitted (Sanctioned / OracleUnavailable), check returns false, bridge returns successfully without emitting a TransactionDeposited / MessagePassed.
  • Opt-in. compliance == address(0) disables the module. L1 sets the address via initialize (governance-gated proxy upgrade to change). L2 has setCompliance(address(0)) gated to the L2ProxyAdmin owner.
  • L2 predeploy at 0x420000000000000000000000000000000000002D.

Trade-off discussion

The no-recovery design is the central trade-off. It eliminates an admin-key-compromise vector and dramatically shrinks the contract, but it makes oracle false positives and oracle outages translate directly into permanent user loss. The FMA's FM2 and FM4 are scoped around this. The Alternatives section documents auto-bounce-to-sender and burn-to-zero as drop-in alternative dispositions if reviewers prefer one of those.

Test plan

This is a documentation change. Reviewers should:

  • Read protocol/compliance-module.md end-to-end and confirm the design is internally consistent (interface, contract, bridge changes, predeploy, alternatives, risks).
  • Read security/fma-compliance.md and confirm FM coverage matches the design (six FMs: bridge-blocking bugs, locked compliant ETH, access control, Chainalysis dependency, dispute-game interaction, generic SC).
  • Confirm both Mermaid diagrams render and reflect the compliant / sanctioned / oracle-unavailable branches.
  • Sanction-check the no-recovery decision against operator UX requirements; if a refund path is required, point reviewers at the auto-bounce / burn alternatives in the Alternatives section.

🤖 Generated with Claude Code

tynes and others added 4 commits June 23, 2026 13:56
Introduce an optional compliance screening layer for cross-chain
transactions in the OP Stack bridge. The design covers L1 deposit
screening via OptimismPortal2, L2 withdrawal screening via
L2ToL1MessagePasser, configurable IRule-based checks, and owner-
controlled approve/reject/settle flows with ETH custody and refunds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The L1 deposit and L2 withdrawal flow diagrams had several inaccuracies
compared to the detailed design: missing donateETH() on the happy path,
incorrect owner/settle flow, wrong labels ("Deposit" instead of
"Withdrawal"), and missing nonce reservation step. Updated both diagrams
to accurately reflect the contract interactions described in the doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the abstract Compliance + L1Compliance + L2Compliance design with a
single ChainalysisCompliance contract behind a minimal ICompliance.check(from, to)
interface. Remove the IRule plugin system, the Pending/Rejected state machine,
the owner-override bit packing, and the settle/approved callbacks.

Remove the owner role entirely: the contract has no admin functions and no
ETH-egress function. ETH on screened-out transactions (sanctioned or
oracle-unavailable) is permanently locked. Document auto-bounce-to-sender and
burn-to-zero as alternative dispositions in the Alternatives section.

Update the FMA: drop the owner-compromise and owner-loss failure modes; reframe
the locked-ETH analysis around permanent loss from check() bugs or oracle false
positives; expand the Chainalysis-dependency analysis to cover the
loss-on-failure semantics; renumber.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove the L2ToL1MessagePasser integration, the L2 predeploy at
0x420000000000000000000000000000000000002D, and the L2 → L1 withdrawal
flow. The Chainalysis Sanctions Oracle is not deployed on most OP Stack
chains, and shipping an L2 module without a corresponding oracle would
force operators onto a custom ICompliance implementation on day one.

Update the FMA: scope FM1/FM3/FM4 to deposits, drop FM5
(dispute-game / withdrawal-proving interaction), renumber the generic
smart contract failure modes section to FM5. Drop setCompliance and
L2ProxyAdmin references throughout.

Reframe "Compliance only on L1" in Alternatives Considered as
"Compliance on both L1 deposits and L2 withdrawals" — describing the
rejected dual-direction design and the L2 oracle availability gap that
motivates the cut. Document withdrawal-side exposure as a known risk.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tynes
tynes force-pushed the compliance-module-2 branch from 4b3a980 to 9cbf030 Compare June 23, 2026 17:56
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