payments: the public reader of a receipt is tested on 20 named cases (was 14), including a run with no usable verifier, which now stops before reading the chain and says why (proba-plata-fara-verificator.mjs, new); proba-plata-28001.mjs exits with the reason when the verifier is missing; README counts updated (1255 files).

This commit is contained in:
Aere Network committed 2026-10-28 00:30:32 +02:00
1 parent 687e5e54a4
commit 5f1b781e7f
6 files changed
+269 -75

No files matched your search

+18 -7
View File
@@ -25,9 +25,12 @@ the inputs and was ALLOW, and, with the chain facts, that the transaction is thi
node proba-risc.mjs # 23 rows, no chain: the verdicts under a policy, a receipt verified, nine forged ones refused by name,
# a malformed payment refused by name (a verdict, not an exception)
node proba-risc.mjs --control-negativ # 10 plantings on copies of risc.mjs and chitanta.mjs; each forged fixture must then be accepted
AERE_TESTNET_KEY_FILE=<key> AERE_ETHERS_DIR=<dir with node_modules/ethers> node proba-plata-28001.mjs # the flow on testnet 28001
AERE_TESTNET_KEY_FILE=<key> AERE_ETHERS_DIR=<dir with node_modules/ethers> AERE_VERIFY_PROOF=<verify-proof.mjs> node proba-plata-28001.mjs
# the flow on testnet 28001; AERE_VERIFY_PROOF names the reference verifier (verify-proof.mjs as served at aere.network/tools, with verify-anchor.mjs, mpt.mjs, falcon512.mjs, registry-v3.mjs and package.json beside it and `npm install` done there),
# and without a usable one the flow stops NEMASURAT before it reads or sends anything
node proba-plata-fara-verificator.mjs # 4 rows, no chain: that refusal, before any request, against a local stub that counts them
node verifica-chitanta.mjs dovezi/chitanta-28001-<date>.json --rpc https://testnet-rpc.aere.network --verify-proof <verify-proof.mjs>
node proba-verifica-chitanta.mjs # 14 rows, no chain: the public reader against a local RPC stub and a stub of the reference
node proba-verifica-chitanta.mjs # 20 rows, no chain: the public reader against a local RPC stub and a stub of the reference
# verifier, each exit code and verdict word as POST /v1/payments/verify gives them
```
@@ -35,13 +38,19 @@ Measured on 2026-10-02 on testnet 28001 (9/9): a person's payment of 0.4 tAERE a
by a plain transfer the payer signed, its receipt issued, notarized by the payee and read back with finality PASSED under a
post-quantum certified anchor; a payment of 1.50 USD refused above the per-payment limit with no transaction sent; the fourth payment
in the window refused above the count; the receipt forged (amount changed) INVALID; a looser policy shown under the receipt's policy
hash INVALID. The public reader (`verifica-chitanta.mjs`) needs only Node.js: the chain is read by plain JSON-RPC. Its file is the
hash INVALID. The public reader (`verifica-chitanta.mjs`) needs only Node.js, and reads the chain by plain JSON-RPC; its verdict `VALID`
also needs the reference verifier, verify-proof.mjs as served at aere.network/tools, with verify-anchor.mjs, mpt.mjs, falcon512.mjs, registry-v3.mjs and package.json beside it and `npm install` done there (corrected 2026-10-27: this said the reader needs only Node.js, and
`verify-proof.mjs` alone stops at its first import). Its file is the
receipt with the policy and the inputs the issuer judged (the `receiptFile` of the Payments API's receipt route), and its verdicts are
those of POST /v1/payments/verify: exit 0 `VALID` only when the transaction is compared on chain and the reference verifier finds the
notarization under a post-quantum certified anchor (finality `PASSED`), 1 `INVALID` with the reasons, 2 `PARTIAL` when something was
not measured (no `--rpc`, no chain answer, an RPC of another chain, no `--verify-proof`, the policy or the inputs missing, finality
`PENDING` or `UNMEASURED`). Corrected 2026-10-27: until this date it wrote `VALID` and exited 0 without `--verify-proof` and while
the notarization was pending, and it called a file without the policy and the inputs `INVALID`.
not measured (no `--rpc`, no chain answer, an RPC of another chain, no `--verify-proof`, a reference verifier that ran and gave no
verdict, the policy or the inputs missing, finality `PENDING` or `UNMEASURED`). Corrected 2026-10-27: until this date it wrote `VALID`
and exited 0 without `--verify-proof` and while the notarization was pending, and it called a file without the policy and the inputs
`INVALID`. Corrected again the same day: an RPC of another chain was handed on to the reference verifier, which answered `FAILED`, so
an authentic receipt came out `INVALID` (the envelope is now judged offline and the verdict is `PARTIAL`); a verifier that did not
start was reported as "not run" (it is now "ran, gave no JSON", with its error line); a file that is not a receipt ended in an
exception with the exit code of `INVALID` (it is now `INVALID` by name).
Every refusal names its rule, in the module's working language: `rules` on a risk verdict (`forma`, `activ`, `contrapartida`,
`curs`, `limita`, `fereastra`, that is form, asset, counterparty, rate, limit and window; outside the hashed body, so the hash of a
@@ -64,5 +73,7 @@ window. The conformance suite (`conformance/`) holds a vector for each of these
receipt); a wrong declared rate gives a wrong USD figure, honestly attributed.
- **Native transfers only in the measured flow.** An ERC-20 payment (the testnet USD token through x402) is supported by the policy's
asset list but not measured; the receipt's chain check compares `value` only for the native asset.
- **Not a payment API.** No service, no queue, no callbacks; the issuer runs these modules in its own process.
- **This module is not a service.** The issuer runs it in its own process, or calls the hosted Payments API of Aere Cloud, which runs
these modules (`POST /v1/payments/risk`, `/receipt`, `/verify`, with a key); there is no queue and no callback, and nothing here
moves money. (Corrected 2026-10-27: this line said "Not a payment API", while the hosted API exists.)
- **Chain 2800: nothing** ran there; test keys only, the payee's derived from the payer's and never printed.