Monero¶
Monero support is experimental. R24 remains Critical. CLSAG, RingCT, multisig, parser behavior, wallet interoperability, and the native verifier boundary remain high risk.
Monero must remain testnet and value capped. Use it with real funds only after completing the Operator Checklist and explicitly accepting R24.
Scope¶
- CLSAG 2 of 3
- Ring size 16
- Exactly one buyer, one seller, and one arbiter
- Native XMR only
- Quorum only refund, or pre signed
unlock_timerefund - Caller supplied transaction sets and ring context
- External funding verifier, settlement verifier, and native crypto verifier
Not supported:
- Thresholds other than 2 of 3
- Ring sizes other than 16
- Private view key intake
- Wallet scanning
- Transaction construction
- Multisig key exchange
- Broadcast
- Mainnet production use before R24 is closed
Required components¶
Monero flows require three external components.
Funding verifier: an object with verify(terms, evidence, context). It
attests that the funding output belongs to the multisig and that the amount is
correct.
Settlement verifier: an object with verify(terms, plan, signed, ring). It
attests the payout address and amount, which RingCT hides from the public
verifier.
Native crypto verifier: MoneroOxideVerifier, which parses the signed
transaction set and verifies CLSAG, range proofs, commitment balance, fee, unlock
time, output keys, and output commitments.
Missing, failing, or malformed verifier output fails closed.
Addresses and terms¶
Obtain the multisig address, payout addresses, public spend keys, and approval keys from your wallet and multisig setup. The library validates the address network, checksum, spend key, and view key.
from multisig_escrow import SignerId
from multisig_escrow.monero import (
MoneroApprovalKey,
MoneroChain,
MoneroFeePolicy,
MoneroMultisigDescriptor,
MoneroNetwork,
MoneroPayout,
MoneroRefundMode,
MoneroSigner,
MoneroTerms,
MoneroViewKeyPolicy,
)
from multisig_escrow import Role
buyer = MoneroSigner(
SignerId("buyer"),
Role.BUYER,
public_spend_key=buyer_spend_key,
approval_key=MoneroApprovalKey(buyer_approval_public_key),
)
seller = MoneroSigner(
SignerId("seller"),
Role.SELLER,
public_spend_key=seller_spend_key,
approval_key=MoneroApprovalKey(seller_approval_public_key),
)
arbiter = MoneroSigner(
SignerId("arbiter"),
Role.ARBITER,
public_spend_key=arbiter_spend_key,
approval_key=MoneroApprovalKey(arbiter_approval_public_key),
)
multisig = MoneroMultisigDescriptor(
address=multisig_address,
signers=(buyer, seller, arbiter),
threshold=2,
ring_size=16,
wallet_identity_hash=wallet_identity_hash,
)
chain = MoneroChain(
network=MoneroNetwork.STAGENET,
genesis_hash=genesis_hash,
)
terms = MoneroTerms(
chain=chain,
multisig=multisig,
buyer_payout=MoneroPayout(buyer_address, 0, 0),
seller_payout=MoneroPayout(seller_address, 0, 1),
amount=1_000_000,
fee_policy=MoneroFeePolicy(1, 1_000),
view_key_policy=MoneroViewKeyPolicy(
(SignerId("buyer"), SignerId("seller")),
),
refund_mode=MoneroRefundMode.QUORUM_ONLY,
)
MoneroMultisigDescriptor requires exactly three signers with the three roles,
a 2 of 3 threshold, ring size 16, and a 32 byte wallet identity hash.
MoneroViewKeyPolicy describes who may scan or attest. The library does not
accept a private view key. It only records the policy and checks funding evidence
against it.
Create an escrow¶
from multisig_escrow import MemoryStore, SystemClock
from multisig_escrow.monero import MoneroEscrow
store = MemoryStore()
clock = SystemClock()
escrow = MoneroEscrow.create(terms, store=store, clock=clock)
Optional keyword arguments:
funding_deadlinesettlement_deadlineconfirmation_policyescrow_id
Defaults are one day for funding, thirty days for settlement, one funding confirmation, one settlement confirmation, and a random escrow ID.
Loading requires the original Monero terms:
escrow = MoneroEscrow.load(
escrow_id,
terms,
store=store,
clock=clock,
trusted_terms_hash=trusted_terms_hash,
)
The Monero terms hash is bound into the core terms as metadata_hash. A mismatch
raises StateError.
Funding¶
target = escrow.funding_target(confirmations=10)
print(target.address)
print(target.amount)
escrow.fund(evidence, context, verifier=funding_verifier)
MoneroFundingEvidence contains:
txidoutput_indexoutput_keycommitmentamountconfirmationsblock_heightprooforattestationmode
MoneroFundingMode.TRANSACTION_PROOF requires a 64 byte proof. The default
MoneroViewKeyPolicy requires a transaction proof, so set
mode=MoneroFundingMode.TRANSACTION_PROOF and provide proof. If the policy
allows attestation, use MoneroFundingMode.ATTESTED_SCAN or
MoneroFundingMode.EXTERNAL_VERIFIER and supply a 64 byte attestation.
The context tip must not be in the future and must not be older than one hour. The declared confirmations cannot exceed the depth implied by the tip.
The funding verifier is mandatory. A None verifier raises VerificationError.
Release proposal¶
A Monero release plan is built from key images, fee, ring context hash, unsigned transaction set hash, optional change, and output bindings.
from multisig_escrow.monero import (
MoneroKeyImage,
MoneroReleaseParams,
)
params = MoneroReleaseParams(
key_images=(
MoneroKeyImage(
key_image=key_image,
txid=funding_txid,
output_index=0,
ring_size=16,
unsigned_tx_hash=unsigned_tx_hash,
),
),
fee=1_000,
ring_context_hash=ring_context_hash,
unsigned_tx_set_hash=unsigned_tx_set_hash,
change=change_amount,
output_bindings=output_bindings,
)
plan = escrow.propose_release(SignerId("buyer"), params)
The key image must bind to the funding transaction and output index. The plan must include output bindings for each output, including change when present. A release has unlock time zero and pays the seller payout.
Approvals¶
Monero approvals use Ed25519 keys, not Monero spend keys.
from multisig_escrow.monero import MoneroApproval
context = escrow.approval_context(params.key_images[0].key_image)
digest = context.digest()
signature = buyer_approval_private_key.sign(digest)
escrow.approve(
MoneroApproval(
SignerId("buyer"),
"buyer approval key",
signature,
params.key_images[0].key_image,
)
)
The approval context binds the chain, escrow ID, terms hash, proposal ID, payload hash, key image, and unlock time. The signature must verify against the approval key registered for that signer.
Verification and finalization¶
from multisig_escrow.monero import MoneroOxideVerifier
native = MoneroOxideVerifier.from_env()
token = escrow.verify_settlement(
signed_tx_set,
ring,
verifier=native,
settlement_verifier=settlement_verifier,
)
verify_settlement checks:
- Escrow status is
release_readyorrefund_ready - Ring tip is fresh
- Signed key images match the plan
- Signed outputs match the plan
- Signed output keys and commitments match the output bindings
- Fee is within policy and matches the plan
- Unlock time matches the plan
- Native verifier accepts the transaction set and ring
- Settlement verifier attests the payout address and amount
finalize(signed_tx_set, ring, verifier, settlement_verifier=...) repeats the
verification and returns a FinalizedSettlement. It does not change state and
does not broadcast.
Broadcast and confirmation¶
escrow.mark_broadcast(
token,
signed_tx_set,
ring,
verifier=native,
settlement_verifier=settlement_verifier,
)
escrow.confirm(signed_tx_set.txid, confirmations=10)
mark_broadcast requires the settlement token, verifies the settlement again,
and checks that the token binding matches. confirm records caller supplied
confirmation evidence and advances to released or refunded when the policy is
met.
Ring context¶
MoneroRingContext contains the tip, ring members, output commitments, optional
unlock height, and ring commitments.
- Ring size is 16.
- Ring members must be unique within each ring.
- Ring commitments are required by the native verifier.
- The tip must be fresh.
- Ring and output data must match the signed transaction set.
Ring data is caller supplied. The library does not scan the chain.
Refund modes¶
Quorum only: the refund plan has unlock time zero and follows the refund approval policy.
Pre signed unlock: the refund plan uses the unlock_time and unlock_unit
in the terms. A pre signed refund also requires a seller acknowledgement that
binds the refund hash, key image, fee, and unlock time.
plan = escrow.propose_refund(
SignerId("buyer"),
refund_params,
acknowledgement=refund_acknowledgement,
)
A pre signed refund is a bearer transaction after the unlock time. Disclose that tradeoff to both parties before funding.
Native verifier¶
Build the verifier from the pinned Rust source:
Select it with an environment variable:
Or pass an explicit path:
from multisig_escrow.monero import MoneroOxideVerifier
native = MoneroOxideVerifier("/absolute/path/to/monero_oxide_verify")
Production deployments must build from a pinned source revision and reviewed lock file, verify the binary digest, and ship it through a signed release channel. The verifier is not bundled in the wheel.
R24¶
R24 covers unknown defects in:
- CLSAG verification
- RingCT and range proof handling
- Monero multisig behavior
- Transaction parsing
- Wallet interoperability
- The native verifier boundary
Controls:
- Testnet or stagenet deployment
- Explicit value caps
- Pinned native verifier and verified digest
- Required funding and settlement verifiers
- Fresh ring context
- Key image and output binding checks
- Explicit signed R24 acceptance before funding
R24 remains Critical. Do not treat a successful test transaction as a security proof.
Operational notes¶
- Verify the multisig address and payout addresses on independent devices.
- Use a dedicated wallet for the escrow.
- Never share a private view key with the coordinator.
- Pin the native verifier and verify its digest on every deployment.
- Require a transaction proof or independent attestation for funding.
- Reject stale or future ring tips.
- Keep the trusted terms hash outside the store.
- Keep Monero testnet and value capped.