Reference implementation · baseline profile

The reference implementation — what it implements, and what it defers

PayTP's baseline-profile reference implementation: what the code actually proves, and — just as plainly — the boundaries it draws on purpose. Every deferral below is a declared boundary, not a gap left to discover.

Generated from the reference implementation's SCOPE.md. A baseline-profile conformance and measurement artifact — not production money software: nothing here is deployed, and nothing here moves real funds.

paytp-ri is the baseline-profile reference implementation of the PayTP open payment protocol. Read this before reading any claim the code or the demos make: it states plainly what this repository proves, and — just as plainly — the boundaries it draws on purpose. Every deferral below is a declared boundary, not a gap left for a reader to discover.

This is not production money software. Nothing here is deployed, and nothing here moves real funds.


What it is#

A baseline-profile, transport-independent, virtual-rail reference and conformance implementation of PayTP:

The formal spec (F1–F10) and the whitepaper are the source of truth, published at paytp.org/spec and paytp.org/whitepaper; this repository implements that spec at the commit pinned in PINNED_SPEC. It does not decide the spec — a divergence found while building moves the spec first.


What it proves#

Exercised end‑to‑end, with an executable test or an explicit classification behind each normative baseline MUST (see conformance/COVERAGE.md):


Conformance corpus — coverage highlights#

The baseline profile is checked against the F10 conformance-vector corpus and a normative-MUST coverage map. The host workspace runs 541 tests green plus the separate contract LiteSVM suite, CI exit 0. These are highlights; the full spec-rule → test matrix (F1–F10) lives in conformance/COVERAGE.md in the repository.

The baseline coverage the RI carries, each keyed to executable tests:

  1. Concurrent nonce race / exactly-once (F4.4) — adversary::duplicate_settlement_race_consumes_the_nonce_exactly_once proves exactly-once delivery under a 32-way thread race (T4).
  2. x402 attack classes as must-FAIL testsadversary::{cross_resource_substitution_is_refused, duplicate_settlement_race_*, leaked_token_resubmission_is_refused, delivery_requires_settlement_first, underpayment_is_refused_no_upto_allowance} (T4).
  3. Registry adversary testsadversary::{rogue_os_assertion_cannot_move_value_to_the_asserter, invalid_meed_vector_is_refused, stale_or_revoked_registry_version_is_refused} (T4).
  4. Entry-machine attacksadversary::{nonce_desync_funds_an_orphan_the_merchant_never_quoted, zero_contest_window_still_requires_a_full_tick_before_reclaim} (T4).
  5. Bare-request-is-not-authorization (F4) — covered by construction: the merchant has no delivery path without a verified payment; the two-leg/redeem flows all require a bound payment ref (twoleg_e2e::*, adversary::delivery_requires_settlement_first).
  6. §10.4 external-wallet selection + wallet-substitutionpaytp-client + paytp-wallet built; substitution::two_distinct_wallets_drive_the_same_flow_through_the_same_interface drives two distinct wallet types through the PayerWallet trait (T2/T3).
  7. Composition vectors (COVERED, slice-MAC, H(s), BindSalt, K_session, head_0) — composition_independent::composition_anchors_confirmed_by_an_independent_path + pinned in f1-crypto.json, consumed by both conformance::f1_crypto_anchors and the independent path (T5).
  8. Control-path suffix joining (F2 path MUST NOT end in /) — discovery::{control_path_must_not_end_in_slash, resource_suffix_joining_is_deterministic} (T2).
  9. Launch-gated tail (not dev-gate; classified): TLS 0-RTT early-data reject (F1, §A — transport-independent RI has no TLS surface); artifact-specific no-store (F2-i, rides the live HTTP stack); CKPT_TIMEOUT/SETTLE_TIMEOUT start/expiry (F8 — thin at the driver).

Coverage verified (M8). The adversary suite is green (15 adversary tests); the composition anchors are independently re-derived; wallet substitution drives two distinct wallet types through the PayerWallet trait. Every non-COVERED row below is a stated classification — a launch-gate boundary (SCOPE.md), a certification-level §10.5 obligation, or a by-design builder classification — never a silent gap.

Classified (not a row above): two-leg quotes have no interaction-layer resource binding — the client's resource check is baseline-only, because there is no client two-leg entry point yet (two-leg is driven directly by the wallet). CLASS:gap — add the resource binding when a client two-leg flow is built; the wallet still verifies the two-leg signature and extracts terms from it, so a compromised interaction layer cannot forge two-leg terms, only (at most) present a signed quote for a resource the operator did not ask for.


What it deliberately does NOT do (yet) — declared boundaries#

These are intentional scope limits of the baseline‑profile RI. Each is honest because it is named here; none is a hidden gap.

Forward‑conformance boundaries (inert in every flow the RI produces)#

These are narrower conformance limits. None affects a flow this RI actually runs — each is inert today — and each is named here so it is a declared limit, not a latent gap a future profile discovers:

Now implemented (previously a boundary)#

Placeholder governance constants (release‑bound, fail‑closed)#

The Development Fund destination, the independent open‑source‑fund destination, and the Foundation registry key in crates/paytp-core/src/consts.rs are release‑bound sentinels, not real addresses (F9‑e: these cannot be derived from F1–F10 alone — they are pinned at a release). Beyond carrying obvious PLACEHOLDER-… sentinel text, they are guarded so they cannot be confused with real governance wiring: consts::ensure_governance_ready is a fail‑closed guard wired into the governed value path (registry resolution and governed‑vector validation). A build that has not opted into the placeholders via the demo-governance feature — i.e. any non‑demo / non‑proof build — refuses to run a value decision while the placeholders are in place, rather than silently settling a governed share to an unspendable sentinel. A real deployment replaces the placeholders (and does not enable that feature) before the value path will run.


Where to look next#

If you want…Read
The public protocol spec + whitepaperpaytp.org/spec · paytp.org/whitepaper
The crate map + money‑path read orderARCHITECTURE.md
The spec‑rule → test indexconformance/COVERAGE.md
The runnable demosdemos/README.md
Status + milestonesREADME.md