design-doc: compliance module (Chainalysis-backed ICompliance) - #380
Open
tynes wants to merge 4 commits into
Open
design-doc: compliance module (Chainalysis-backed ICompliance)#380tynes wants to merge 4 commits into
tynes wants to merge 4 commits into
Conversation
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
force-pushed
the
compliance-module-2
branch
from
June 23, 2026 17:56
4b3a980 to
9cbf030
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
protocol/compliance-module.md: an optional, opt-in compliance screening layer forOptimismPortal2(deposits) andL2ToL1MessagePasser(withdrawals). The bridges call a singleICompliance.check(from, to)hook; one concrete implementation,ChainalysisCompliance, wraps the on-chain Chainalysis Sanctions Oracle.security/fma-compliance.md: the failure mode and recovery analysis for the module.msg.valueon 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
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.Compliance+L1Compliance+L2Compliancesplit, anIRuleplugin set, a four-state status enum with bit-packed owner-override, and asettle/approvedcallback flow. All of that is gone. The deployedChainalysisCompliancehas noOwnable, norecover, nosettle, notransferOwnership.donateETHback to bridge → bridge proceeds. Sanctioned or oracle-failure: ETH retained, distinct event emitted (Sanctioned/OracleUnavailable),checkreturnsfalse, bridge returns successfully without emitting aTransactionDeposited/MessagePassed.compliance == address(0)disables the module. L1 sets the address viainitialize(governance-gated proxy upgrade to change). L2 hassetCompliance(address(0))gated to theL2ProxyAdminowner.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:
protocol/compliance-module.mdend-to-end and confirm the design is internally consistent (interface, contract, bridge changes, predeploy, alternatives, risks).security/fma-compliance.mdand confirm FM coverage matches the design (six FMs: bridge-blocking bugs, locked compliant ETH, access control, Chainalysis dependency, dispute-game interaction, generic SC).🤖 Generated with Claude Code