Security¶
Status¶
Version: 0.1.0
R24: Critical
R24 remains Critical. Monero CLSAG, RingCT, multisig, parser behavior, wallet interoperability, and the native verifier boundary remain high risk. Monero is experimental and must remain testnet and value capped. Use it with real funds only after completing the operator checklist and explicitly accepting R24.
Scope¶
Only these coins and chains are supported for now.
- Bitcoin: BTC with P2WSH, descriptors, and PSBT.
- EVM: ETH and allowlisted ERC20 on supported EVM chains with Safe v1.3.0 or v1.4.1.
- Monero: XMR with experimental CLSAG 2 of 3.
Additional coins and chains will be added in future releases. Other chains are out of scope.
What the library guarantees¶
For supported flows, the library provides these properties.
Canonical terms: Terms are validated and hashed deterministically. A changed term produces a different hash.
Payload binding: Proposals bind the escrow ID, terms hash, action, recipient, amount, fee, and exact payload hash.
Approval binding: Approval tokens bind the signer, proposal, payload hash, signature hash, and chain evidence where applicable. Approvals from one payload do not authorize another.
Policy enforcement: Release, refund, and dispute policies are checked against the signer set and threshold. Unknown signers are rejected.
Fail closed behavior: Missing dependencies, missing verifiers, malformed evidence, stale context, conflicting store writes, and invalid state transitions raise errors. They do not silently succeed.
No key custody: The library does not accept private keys, private view keys, seed phrases, wallet files, or multisig secret shares. It does not sign.
No network access: The library does not connect to a node, RPC endpoint, or wallet. It does not broadcast.
What the library does not guarantee¶
Chain truth: Funding, confirmation, broadcast, and settlement evidence is caller supplied. The library verifies structure and binding, not inclusion in the best chain.
Store integrity: A store can be rewritten. The embedded terms hash is not an authenticated trust anchor. Keep a trusted hash outside the store.
Signer honesty: The library cannot prove that a signer verified the device display or that the signer is not coerced.
Payout identity: The library cannot prove that a payout address belongs to the intended party. Confirm it through an independent channel.
Token behavior: ERC20 contracts are external. A malicious or upgradeable token can change behavior. Use an allowlist and verify balance changes.
Monero ownership and hidden amounts: RingCT hides the address and amount from the public verifier. The required funding verifier and settlement verifier must attest those facts.
External verifier correctness: The native verifier, funding verifier, and settlement verifier are trust boundaries. A compromised or defective verifier can accept bad evidence.
Availability: The library does not provide a service, database, queue, or high availability deployment.
Trust boundaries¶
The main trust boundaries are:
- The application that builds terms and evidence
- The store and its access control
- The signing devices and their display
- The chain data source used for evidence and confirmations
- The wallet or signer used for signatures
- The Monero funding verifier
- The Monero settlement verifier
- The pinned Monero Oxide binary and its dependency graph
- The operator checklist and human review
The library reduces ambiguity and rejects malformed artifacts. It does not remove the need to trust these boundaries.
Store threats¶
The store is a consistency layer, not a trust anchor.
Threats:
- Rewriting terms and recomputing the hash
- Replaying an old record
- Rolling back a revision
- Concurrent writers producing divergent state
- Unauthorized reads of payout or evidence data
- Loss of approval payloads before finalization
Controls:
- Keep the trusted terms hash outside the store.
- Authenticate and authorize store access.
- Use atomic compare and set on the revision.
- Keep an append only change history.
- Back up and test recovery.
- Implement payload persistence if you reload between approval and finalization.
- Do not expose the store directly to untrusted clients.
Evidence threats¶
Threats:
- False funding evidence
- False confirmation depth
- Stale or future chain tip
- Replayed settlement artifact
- Mismatched output script or address
- Mismatched Safe nonce
- Mismatched Monero key image or output binding
- Malformed native verifier output
Controls:
- Use a trusted chain source.
- Reject stale or future tips.
- Check block depth against declared confirmations.
- Verify the exact payload hash and payout.
- Verify the Safe nonce from a trusted source.
- Pin and hash check the Monero native verifier.
- Require funding and settlement verifiers.
- Recheck evidence before each transition.
Signing threats¶
Threats:
- A signer signs a different payload than the coordinator displays
- A compromised coordinator changes the payout
- A signature is replayed across proposals
- A signer key is used outside the escrow policy
- A hardware wallet displays incomplete information
Controls:
- Verify the destination, amount, fee, network, asset, change, nonce, and timelock on the signing device.
- Compare the payload hash or signing digest across devices.
- Use independent payout verification.
- Keep approval tokens bound to the proposal and payload.
- Reject unknown signers and duplicate signatures.
- Use a signer policy that matches the onchain or wallet policy.
Bitcoin risks¶
- False funding evidence
- Fee and dust policy mismatch
- UTXO selection and change handling
- Lost quorum or lost keys
- CSV refund tradeoff
- Chain reorganization
- Signer display errors
Use a confirmation policy appropriate to the value at risk. Verify the PSBT on the signing device. Do not reuse a UTXO across proposals.
EVM risks¶
- Supplied Safe state does not match the deployed Safe
- Safe owner or threshold mismatch
- Stale Safe nonce
- Malicious or upgradeable ERC20
- Safe execution log mismatch
- Chain reorganization
- No native timelock
Verify the Safe address, code, owners, threshold, version, and nonce against a trusted source. Use an ERC20 allowlist. EVM deadline enforcement is in the escrow state machine, not in the Safe.
Monero risks¶
R24 remains Critical. It covers unknown defects in:
- CLSAG verification
- RingCT and range proof handling
- Monero multisig behavior
- Transaction parsing
- Wallet interoperability
- The native verifier boundary
Other Monero risks include:
- View key disclosure
- False funding or amount evidence
- Stale or conflicting key images
- Pre signed refund tradeoff
- Stale ring context
- Wallet or daemon differences
- Mainnet use before R24 is closed
Controls:
- Testnet or stagenet only
- Explicit value caps
- Pinned native verifier with verified digest
- Required funding and settlement verifiers
- Fresh ring context
- Key image binding to funding
- Output key and commitment binding
- Explicit signed R24 acceptance
- Dedicated wallet and strict view key policy
- Conservative fee and unlock time for pre signed refunds
Concurrency¶
The store uses optimistic revision checks. Concurrent writers can receive
StoreConflictError. The library fails closed and does not merge state.
Use one writer per escrow, a per escrow lock or queue, or a retry loop after reloading the latest record. Do not share a mutable facade across threads without external serialization.
Deployment guidance¶
- Pin the library version.
- Install only the chain extras you use.
- Run with a supported Python version.
- Use a durable, authenticated store.
- Keep the trusted terms hash outside the store.
- Pin and verify external verifiers.
- Log state transitions and evidence hashes.
- Alert on verification failures and store conflicts.
- Test recovery and restore procedures.
- Keep Monero testnet and value capped.
- Review the Operator Checklist before funding.
Reporting¶
Report suspected vulnerabilities privately to the maintainers. Do not open a public issue for a report that may affect funds.
Include:
- Affected version
- Chain and adapter
- Reproduction steps or vector
- Impact
- Whether funds are at risk
- Any proposed mitigation
- Whether AI tools were used, if relevant to the report
Do not include private keys, seed phrases, private view keys, or live secrets in a report. Use a minimal proof of concept with test data.
Contributions¶
Contributions are very much appreciated. If you find an issue, a vulnerability, or a bug, whether you used AI or not, please report it and submit a fix if you can. This project is maintained by one developer.
Read Contributing.