x402 integration
Scheme id batch-settlement-shielded. The x402 SVM batch-settlement binding requires implementations to target the canonical payment-channels program id and takes no program id from extra, so a PER-based escrow cannot advertise scheme: "batch-settlement"; Wakeless registers a sibling id and copies the standard everywhere the standard does not name the public program. docs/SCHEME.md records, with spec line numbers, what is reused verbatim and what changes.
What stays standard: the x402 V2 envelope (x402Version: 2, accepts[], paymentPayload, paymentRequirements); the three transport headers PAYMENT-REQUIRED, PAYMENT-SIGNATURE, PAYMENT-RESPONSE; the three facilitator endpoints; the authorization flow (verify, resource, settle); the 50-byte voucher (0x56 0x01 || channelId || u64le maxClaimableAmount || i64le expiresAt = 0), signed by the client (voucherSigner: "client", the mode the spec says clients should prefer) and verified off chain, never placed on chain; the deposit, voucher and refund payload types; the invalid_batch_settlement_svm_* error codes, settlement_pending and duplicate_settlement verbatim; the corrective 402 of spec section 4.6; and the recovery rules (docs/RECOVERY.md). What changes: the accepts[] entry adds extra.escrowAddress, extra.binding: "magicblock", extra.teeValidator (the identity a client verifies before paying) and extra.privacyFeeBps: 10; channelId is base58(sha256(buyer || escrowAddress || mint || u64le(salt))) instead of the program's PDA, and clientRefId, the encrypted reference of the private transfers, is the decimal u64 of its first eight bytes; the deposit payload carries the client-signed private transfer so the facilitator can verify buyer and amount; new codes take the shielded_ prefix (shielded_attestation_failed, shielded_binding_rejected, shielded_verify_required, shielded_rate_limited, shielded_unauthorized, shielded_facilitator_unavailable, shielded_terms_quoted). A stock @x402/svm client does not speak the new scheme id, so @wakeless/client is the wrapper; a vendor adds one accepts[] entry through @wakeless/vendor.
The three endpoints: GET /supported advertises one kind with escrowAddress and teeValidator taken from the attested binding, and with kinds: [] and extra.error: "shielded_attestation_failed" when attestation failed. POST /verify recomputes the channel id, checks the buyer's signature and applies the watermark rule to the stored channel without writing. POST /settle moves the watermark atomically after a /verify of the same payload within maxTimeoutSeconds, confirms a deposit through the binding, answers a repeated identical payload with the stored result and extra.replayed: true, and takes the buyer's close request. Each redemption produces a facilitator-signed receipt {channelId, period, cumulative, amount, signature, facilitatorSignature} that the vendor fetches from GET /receipts/:channelId and verifies against the signer /supported lists.