The order
signal_intent
signal_intent(taker, provider, amount, rail, rate_e6, expected_amount_minor, payer_id_hash, nonce) -> BytesN<32>
taker.require_auth(), and the taker is not the provider.min_amount ≤ amount ≤ max_amount.- The provider has terms for the rail, or
RailNotAccepted. rate_e6 ≥ min_rate_e6, orRateBelowMinimum.expected_amount_minor ≥ ceil(amount × rate_e6 / 10^13), orFiatBelowRate.- The provider’s allowed takers are empty or include the taker, or
TakerNotAllowed. - The retail quota applies to the party that is not a registered LP. Two LPs trade with no quota.
- The order ID is
sha256(contract ‖ taker ‖ provider ‖ amount ‖ rail ‖ rate_e6 ‖ payer_id_hash ‖ nonce). An existing ID fails withIntentExists. - The escrow address comes from config, never from the caller. The amount is locked.
pay_by = now + pay_window_secsandsettle_by = pay_by + settle_grace_secs.
Worked example: 20 USDC at ₱57.00
Worked example: 20 USDC at ₱57.00
20 USDC is
amount = 200_000_000. ₱57.00 is 5,700 centavos, so rate_e6 = 5_700 × 10^6 = 5_700_000_000.
ceil(200_000_000 × 5_700_000_000 / 10^13) = 114_000 centavos, so the taker pays ₱1,140.00.fulfill_intent
fulfill_intent(intent_hash, claim)
- The order is
ACTIVEandnow ≤ settle_by. claims.verify(claim)passes: a registered verifier key for this network, inside the claim’s issue and expiry times.claim.satisfiedis true, and the claim’s policy is the registered policy for the order’s rail and direction.- The claim’s
context_digestequals the digest the contract rebuilds from the order: order ID, expected amount, currency, payee hash (from the live rail terms, which cannot change while locked), payer hash and the order reference. claims.consume_nullifier(claim.nullifier)succeeds, orNullifierUsed.fee = amount × fee_bps / 10_000. The escrow releases to the taker. Status becomesFULFILLED.
Other exits
Config and LP registry
register_lp(admin, lp), revoke_lp(admin, lp) and is_lp(addr) manage the LP registry. Registration exempts an address from the retail quota. It gives no power over anyone’s funds.