xoonya 3.1.17 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -74
- package/RELEASE_NOTES.md +1 -1
- package/START_HERE.md +38 -134
- package/bin/xoonya-first-run.js +22 -10
- package/bin/xoonya.js +61 -29
- package/lib/native_verify.js +1918 -0
- package/package.json +19 -42
- package/scripts/verify_release_candidate.js +243 -116
- package/scripts/verify_vectors.js +351 -104
- package/verify.js +95 -0
- package/.env.example +0 -10
- package/CARRIED_HANDOFF_DEMO.md +0 -60
- package/COMPATIBILITY_NOTE.md +0 -27
- package/CROSS_RUNTIME_POSTURE.md +0 -77
- package/EXAMPLE_PATHS.md +0 -53
- package/FINAL_CONTRACT.md +0 -445
- package/PARTNER_READY_PATH.md +0 -67
- package/PUBLIC_DEMO_SCRIPT.md +0 -79
- package/SERVICE_CONTRACT.md +0 -207
- package/TERMINOLOGY.md +0 -55
- package/WHY_XYTARA_XOONYA.md +0 -43
- package/XNYA_CONFORMANCE_MARK.md +0 -78
- package/XNYA_REFERENCE_IMPLEMENTATIONS.md +0 -157
- package/XOONYA_DEFAULT_PATH_MODEL.md +0 -63
- package/XOONYA_FOLLOWTHROUGH_TRUTH_MODEL.md +0 -63
- package/XOONYA_NATIVE_ATOM_SPEC.md +0 -184
- package/XOONYA_NATIVE_PROOF_FORMAT.md +0 -570
- package/XOONYA_NATIVE_STANDARD_GOVERNANCE.md +0 -119
- package/XOONYA_PROOF_TRUTH_MODEL.md +0 -58
- package/bin/xoonya-release.js +0 -1367
- package/bin/xoonya-review.js +0 -70
- package/examples/integration_boundary_walkthrough.js +0 -37
- package/examples/package_quickstart.js +0 -1007
- package/examples/partner_proof_walkthrough.js +0 -68
- package/examples/proof_review_walkthrough.js +0 -66
- package/examples/review_carried_handoff.js +0 -72
- package/index.js +0 -31
- package/integrations/PROOF_INTEGRATION_PROCESS.md +0 -45
- package/integrations/examples/example-third-party-verifier-registration.record.json +0 -22
- package/integrations/registration-record.schema.json +0 -99
- package/integrations/registry-snapshot.schema.json +0 -36
- package/integrations/registry.js +0 -636
- package/integrations/views.js +0 -36
- package/lib/adapter_certification_contract.js +0 -90
- package/lib/announcement_pack.js +0 -61
- package/lib/artifact_distribution_lane_contract.js +0 -54
- package/lib/asyncapi_contract.js +0 -135
- package/lib/auth_interop_contract.js +0 -69
- package/lib/authority_binding_lifecycle_contract.js +0 -182
- package/lib/bridge_intelligence.js +0 -102
- package/lib/cloudevents_contract.js +0 -79
- package/lib/crypto_agility_matrix.js +0 -131
- package/lib/default_path_contract.js +0 -380
- package/lib/ecosystem_entry.js +0 -64
- package/lib/erc8004_proof_lane_contract.js +0 -64
- package/lib/event_system_lane_contract.js +0 -76
- package/lib/external_proof_import_lane_contract.js +0 -87
- package/lib/feature_control_lane_contract.js +0 -54
- package/lib/followthrough_truth_contract.js +0 -214
- package/lib/framework_lane_contract.js +0 -76
- package/lib/governance_disputes_summary.js +0 -36
- package/lib/governance_intelligence.js +0 -108
- package/lib/identity_interop_contract.js +0 -83
- package/lib/integration_matrix_contract.js +0 -81
- package/lib/launch_narrative.js +0 -53
- package/lib/machine_identity_registry_contract.js +0 -199
- package/lib/major_rails_proof_lane_contract.js +0 -87
- package/lib/offline_verifiability_recovery_contract.js +0 -155
- package/lib/openapi_contract.js +0 -227
- package/lib/operational_receipt_contract.js +0 -165
- package/lib/outreach_proof.js +0 -71
- package/lib/phase_10_closeout_pack.js +0 -45
- package/lib/phase_10_completion_pack.js +0 -76
- package/lib/phase_10_decision_record_pack.js +0 -54
- package/lib/phase_10_decision_resolution_pack.js +0 -53
- package/lib/phase_10_demand_signal_adapters_proof_pack.js +0 -74
- package/lib/phase_10_ecosystem_backlog_triage_proof_pack.js +0 -74
- package/lib/phase_10_freeze_baseline_pack.js +0 -67
- package/lib/phase_10_freeze_review_pack.js +0 -64
- package/lib/phase_10_gate_pack.js +0 -57
- package/lib/phase_10_long_tail_continuity_pack.js +0 -80
- package/lib/phase_10_long_tail_ecosystem_pack.js +0 -68
- package/lib/phase_10_niche_extension_registry_proof_pack.js +0 -74
- package/lib/phase_1_claude_mcp_pack.js +0 -60
- package/lib/phase_1_claude_mcp_proof_pack.js +0 -57
- package/lib/phase_1_ecosystem_pack.js +0 -51
- package/lib/phase_1_openai_codex_pack.js +0 -60
- package/lib/phase_1_openai_codex_proof_pack.js +0 -57
- package/lib/phase_2_base_proof_pack.js +0 -71
- package/lib/phase_2_base_usdc_proof_pack.js +0 -72
- package/lib/phase_2_closeout_pack.js +0 -65
- package/lib/phase_2_completion_pack.js +0 -113
- package/lib/phase_2_decision_record_pack.js +0 -66
- package/lib/phase_2_decision_resolution_pack.js +0 -69
- package/lib/phase_2_eth_proof_pack.js +0 -70
- package/lib/phase_2_evm_base_proof_pack.js +0 -73
- package/lib/phase_2_evm_proof_pack.js +0 -71
- package/lib/phase_2_flip_preview_pack.js +0 -60
- package/lib/phase_2_freeze_review_pack.js +0 -99
- package/lib/phase_2_gate_pack.js +0 -77
- package/lib/phase_2_payment_rails_pack.js +0 -71
- package/lib/phase_2_usdc_proof_pack.js +0 -71
- package/lib/phase_3_brc_proof_pack.js +0 -81
- package/lib/phase_3_bsv_teranode_proof_pack.js +0 -81
- package/lib/phase_3_closeout_pack.js +0 -62
- package/lib/phase_3_completion_pack.js +0 -92
- package/lib/phase_3_decision_record_pack.js +0 -64
- package/lib/phase_3_decision_resolution_pack.js +0 -69
- package/lib/phase_3_freeze_baseline_pack.js +0 -67
- package/lib/phase_3_freeze_review_pack.js +0 -80
- package/lib/phase_3_gate_pack.js +0 -76
- package/lib/phase_3_metanet_proof_pack.js +0 -81
- package/lib/phase_3_native_bsv_pack.js +0 -89
- package/lib/phase_3_native_continuity_pack.js +0 -82
- package/lib/phase_4_attestation_proof_pack.js +0 -75
- package/lib/phase_4_closeout_pack.js +0 -45
- package/lib/phase_4_completion_pack.js +0 -82
- package/lib/phase_4_decision_record_pack.js +0 -54
- package/lib/phase_4_decision_resolution_pack.js +0 -45
- package/lib/phase_4_erc8004_proof_pack.js +0 -76
- package/lib/phase_4_freeze_baseline_pack.js +0 -67
- package/lib/phase_4_freeze_review_pack.js +0 -68
- package/lib/phase_4_gate_pack.js +0 -58
- package/lib/phase_4_identity_registry_proof_pack.js +0 -75
- package/lib/phase_4_identity_trust_pack.js +0 -73
- package/lib/phase_4_trust_continuity_pack.js +0 -86
- package/lib/phase_5_antelope_proof_pack.js +0 -76
- package/lib/phase_5_closeout_pack.js +0 -44
- package/lib/phase_5_completion_pack.js +0 -82
- package/lib/phase_5_decision_record_pack.js +0 -54
- package/lib/phase_5_decision_resolution_pack.js +0 -45
- package/lib/phase_5_freeze_baseline_pack.js +0 -67
- package/lib/phase_5_freeze_review_pack.js +0 -68
- package/lib/phase_5_gate_pack.js +0 -58
- package/lib/phase_5_major_rails_continuity_pack.js +0 -86
- package/lib/phase_5_major_rails_pack.js +0 -74
- package/lib/phase_5_proton_xpr_proof_pack.js +0 -76
- package/lib/phase_5_solana_proof_pack.js +0 -76
- package/lib/phase_6_autogen_proof_pack.js +0 -74
- package/lib/phase_6_closeout_pack.js +0 -46
- package/lib/phase_6_completion_pack.js +0 -77
- package/lib/phase_6_decision_record_pack.js +0 -54
- package/lib/phase_6_decision_resolution_pack.js +0 -53
- package/lib/phase_6_framework_continuity_pack.js +0 -81
- package/lib/phase_6_framework_runtime_pack.js +0 -68
- package/lib/phase_6_freeze_baseline_pack.js +0 -68
- package/lib/phase_6_freeze_review_pack.js +0 -65
- package/lib/phase_6_gate_pack.js +0 -59
- package/lib/phase_6_langchain_proof_pack.js +0 -74
- package/lib/phase_6_langgraph_proof_pack.js +0 -74
- package/lib/phase_6_semantic_kernel_proof_pack.js +0 -74
- package/lib/phase_7_closeout_pack.js +0 -45
- package/lib/phase_7_completion_pack.js +0 -85
- package/lib/phase_7_decision_record_pack.js +0 -53
- package/lib/phase_7_decision_resolution_pack.js +0 -53
- package/lib/phase_7_event_system_continuity_pack.js +0 -89
- package/lib/phase_7_event_system_pack.js +0 -76
- package/lib/phase_7_freeze_baseline_pack.js +0 -74
- package/lib/phase_7_freeze_review_pack.js +0 -65
- package/lib/phase_7_gate_pack.js +0 -58
- package/lib/phase_7_kafka_proof_pack.js +0 -76
- package/lib/phase_7_mqtt_proof_pack.js +0 -76
- package/lib/phase_7_nats_proof_pack.js +0 -76
- package/lib/phase_7_webhook_event_bus_proof_pack.js +0 -76
- package/lib/phase_8_closeout_pack.js +0 -46
- package/lib/phase_8_completion_pack.js +0 -82
- package/lib/phase_8_decision_record_pack.js +0 -54
- package/lib/phase_8_decision_resolution_pack.js +0 -53
- package/lib/phase_8_external_receipt_import_proof_pack.js +0 -74
- package/lib/phase_8_external_result_import_proof_pack.js +0 -74
- package/lib/phase_8_freeze_baseline_pack.js +0 -71
- package/lib/phase_8_freeze_review_pack.js +0 -64
- package/lib/phase_8_gate_pack.js +0 -58
- package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
- package/lib/phase_8_proof_bridges_pack.js +0 -72
- package/lib/phase_8_proof_bundle_normalization_proof_pack.js +0 -74
- package/lib/phase_9_closeout_pack.js +0 -46
- package/lib/phase_9_completion_pack.js +0 -82
- package/lib/phase_9_custody_refs_proof_pack.js +0 -74
- package/lib/phase_9_decision_record_pack.js +0 -54
- package/lib/phase_9_decision_resolution_pack.js +0 -53
- package/lib/phase_9_freeze_baseline_pack.js +0 -71
- package/lib/phase_9_freeze_review_pack.js +0 -64
- package/lib/phase_9_gate_pack.js +0 -58
- package/lib/phase_9_operator_accounting_bridges_proof_pack.js +0 -74
- package/lib/phase_9_treasury_connectivity_pack.js +0 -72
- package/lib/phase_9_treasury_continuity_pack.js +0 -86
- package/lib/phase_9_treasury_destinations_proof_pack.js +0 -74
- package/lib/phase_program_pack.js +0 -47
- package/lib/proof_bridge_lane_contract.js +0 -82
- package/lib/proof_truth_contract.js +0 -224
- package/lib/provenance_lane_contract.js +0 -54
- package/lib/provider_lane_contract.js +0 -67
- package/lib/public_surface_policy_contract.js +0 -111
- package/lib/publish_plan.js +0 -51
- package/lib/release_candidate.js +0 -50
- package/lib/release_center.js +0 -1037
- package/lib/release_history.js +0 -206
- package/lib/release_manifest.js +0 -114
- package/lib/release_pack.js +0 -391
- package/lib/result_package_trust_lane_contract.js +0 -74
- package/lib/review_intelligence.js +0 -100
- package/lib/role_freeze.js +0 -436
- package/lib/shared_signals_lane_contract.js +0 -54
- package/lib/signed_audit_provenance_contract.js +0 -93
- package/lib/telemetry_lane_contract.js +0 -54
- package/lib/treasury_proof_lane_contract.js +0 -83
- package/lib/trust_intelligence.js +0 -106
- package/lib/trust_portability_boundary_contract.js +0 -66
- package/lib/trust_portability_pack.js +0 -224
- package/lib/verification_service_pack.js +0 -149
- package/proof_sdk.js +0 -6692
- package/reference/python/README.md +0 -35
- package/reference/python/requirements-optional.txt +0 -1
- package/reference/python/verify_vectors.py +0 -223
- package/reference/python/xnya_reference.py +0 -810
- package/reference/rust/Cargo.toml +0 -11
- package/reference/rust/README.md +0 -28
- package/reference/rust/src/lib.rs +0 -87
- package/scripts/registry_cli.js +0 -157
- package/scripts/verify_all.js +0 -603
- package/scripts/verify_control_plane_contracts.js +0 -34
- package/scripts/verify_control_plane_routes.js +0 -70
- package/scripts/verify_examples.js +0 -19
- package/scripts/verify_external_proof_import_gate.js +0 -84
- package/scripts/verify_external_proof_signature.js +0 -142
- package/scripts/verify_forgery_resistance.js +0 -281
- package/scripts/verify_integrations.js +0 -170
- package/scripts/verify_native_hybrid_design_gate.js +0 -114
- package/scripts/verify_paid_execute.js +0 -133
- package/scripts/verify_paywall_flag.js +0 -86
- package/scripts/verify_reference_promotion_gate.js +0 -74
- package/scripts/verify_reference_python.js +0 -49
- package/scripts/verify_reference_python_crypto.js +0 -87
- package/scripts/verify_reference_rust_scaffold.js +0 -50
- package/scripts/verify_service.js +0 -3038
- package/scripts/verify_tooling.js +0 -1251
- package/scripts/verify_trust_portability.js +0 -56
- package/scripts/verify_verification_services.js +0 -56
- package/server.js +0 -4430
package/README.md
CHANGED
|
@@ -1,111 +1,134 @@
|
|
|
1
1
|
# xoonya
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
governance, and the native **XNYA** machine-evidence format. xoonya is the proof-side half of the
|
|
5
|
-
naxytra machine stack; the runtime/payments half is [xytara](https://naxytra.com/xytara).
|
|
3
|
+
**Verifier for xoonya proofs and naxytra delivery evidence.**
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
xoonya is the proof side of the naxytra machine stack: a hosted proof engine that emits
|
|
6
|
+
deterministic, portable machine evidence for paid agent work, plus this public verifier that lets
|
|
7
|
+
anyone check that evidence offline with classical and **post-quantum** signatures.
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
> The proof engine and server are a hosted service; this package is the verifier. The engine is
|
|
10
|
+
> not distributed.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Adversarially, downgrade-to-classical and the unsigned `none` algorithm are both rejected.
|
|
12
|
+
- Hosted service: https://xoonya.onrender.com
|
|
13
|
+
- Product page: https://www.naxytra.com/xoonya
|
|
14
|
+
- Agent entry points: https://www.naxytra.com/agents
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
> well-formed and cryptographically signed. It is **not** an identity, custody, settlement,
|
|
19
|
-
> transport-security, or chain-finality claim.
|
|
16
|
+
## What this package verifies
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
- **Native proof bundles** (`proof-bundle/v1`) carrying a canonical event bundle and a receipt:
|
|
19
|
+
- `xoonya-native-sha256-v1` — replayable digest (integrity, not authorship)
|
|
20
|
+
- `xoonya-native-signed-v1` — Ed25519 / secp256k1 / P-256 signature bound to the carried public key
|
|
21
|
+
- `xoonya-native-hybrid-v1` — classical + post-quantum dual signature (Ed25519 + ML-DSA-65, FIPS 204)
|
|
22
|
+
- `xoonya-native-anchored-v1` — digest binding to declared chain / batch / finality anchor refs
|
|
23
|
+
- structural acceptance of external envelopes (`detached-assertion`, `jwt-assertion`, `did-vc`,
|
|
24
|
+
`sd-jwt-vc`, `signed-envelope`, `partner-proof-envelope`) and the compatibility `legacy-opreturn` receipt
|
|
25
|
+
- **Detached signatures and compact JWS** — EdDSA, ES256/384/512, ES256K, RS*/PS*, and
|
|
26
|
+
ML-DSA-44/65/87 — with an explicit trusted-key fingerprint model
|
|
27
|
+
- **XNYA machine-evidence atoms**, XNYP payload profiles and line-rate frames
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1. **receive** a handoff or canonical event bundle
|
|
26
|
-
2. **review** it
|
|
27
|
-
3. **verify** it
|
|
28
|
-
4. **emit** a durable proof bundle
|
|
29
|
-
|
|
30
|
-
xoonya owns proof, review, and continuity. It does not own pricing, catalogs, workflow
|
|
31
|
-
orchestration, payment rails, or settlement — those live in [xytara](https://naxytra.com/xytara).
|
|
29
|
+
Everything runs on Node built-ins (`node:crypto`); there are no dependencies.
|
|
32
30
|
|
|
33
31
|
## Install
|
|
34
32
|
|
|
35
33
|
```bash
|
|
36
|
-
npm install xoonya
|
|
34
|
+
npm install xoonya # Node 24 or newer
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
xoonya start-here # the shortest first-run path
|
|
43
|
-
xoonya first-run --verify-native --pretty
|
|
44
|
-
xoonya conformance --json # run proof + adversarial vectors
|
|
45
|
-
xoonya review --help
|
|
46
|
-
```
|
|
37
|
+
## Verify a native proof bundle
|
|
47
38
|
|
|
48
|
-
|
|
39
|
+
A proof bundle is what the hosted service (or a counterparty running it) hands back after a paid
|
|
40
|
+
execution. Verification is deterministic and offline:
|
|
49
41
|
|
|
50
42
|
```js
|
|
51
43
|
const xoonya = require("xoonya");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
//
|
|
44
|
+
const bundle = JSON.parse(require("fs").readFileSync("proof-bundle.json", "utf8"));
|
|
45
|
+
|
|
46
|
+
const result = xoonya.verifyNativeBundle(bundle);
|
|
47
|
+
// {
|
|
48
|
+
// valid: true,
|
|
49
|
+
// verification_method: "xoonya-native-hybrid-v1",
|
|
50
|
+
// verification_state: "verified_native_hybrid_signature",
|
|
51
|
+
// verification_class: "cryptographic",
|
|
52
|
+
// cryptographically_verified: true,
|
|
53
|
+
// public_key_ref: "ed25519+ml-dsa-65-hybrid-spki-sha256:...",
|
|
54
|
+
// classical_public_key_ref: "ed25519-spki-sha256:...",
|
|
55
|
+
// pq_public_key_ref: "ml-dsa-65-spki-sha256:...",
|
|
56
|
+
// ...
|
|
57
|
+
// }
|
|
63
58
|
```
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
A valid result says the bundle is well-formed, bound to the canonical event, and (for signed /
|
|
61
|
+
hybrid methods) really signed by the carried public key. It does not say who controls that key.
|
|
62
|
+
Bind the key to an identity you already trust, and refuse digest-only and structural results, with
|
|
63
|
+
options:
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
```js
|
|
66
|
+
xoonya.verifyNativeBundle(bundle, {
|
|
67
|
+
strict: true, // only cryptographically verified methods pass
|
|
68
|
+
trusted_public_key_refs: {
|
|
69
|
+
"did:xoonya:agent-1": {
|
|
70
|
+
classical: "ed25519-spki-sha256:...",
|
|
71
|
+
pq: "ml-dsa-65-spki-sha256:..."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
// a bundle signed by any other key => { valid: false, reason: "native_hybrid_public_key_not_trusted" }
|
|
76
|
+
```
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
SLH-DSA / FIPS-205), `xoonya-native-anchored-v1`.
|
|
72
|
-
- **External:** `signed-envelope`, `detached-assertion`, `jwt-assertion`, `sd-jwt-vc`, `did-vc`,
|
|
73
|
-
`partner-proof-envelope`, `legacy-opreturn`.
|
|
78
|
+
`verifyNativeProof({ event, receipt, anchors })` does the same for a receipt that is not yet wrapped in
|
|
79
|
+
a bundle. `XOONYA_STRICT_VERIFY=1` turns strict mode on for every call.
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
[`XNYA_CONFORMANCE_MARK.md`](./XNYA_CONFORMANCE_MARK.md).
|
|
81
|
+
## Verify a detached ML-DSA signature
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+
```js
|
|
84
|
+
const result = xoonya.verifyDetachedSignature({
|
|
85
|
+
material: deliverableBytes, // Buffer or string that was signed
|
|
86
|
+
signature: signatureBase64, // base64 (default), "hex" or "base64url" via signature_encoding
|
|
87
|
+
public_key: signerSpkiPem, // SPKI PEM, base64 DER or public JWK; private material is refused
|
|
88
|
+
algorithm: "ML-DSA-65", // or "EdDSA", "ES256", "ES256K", "RS256", "PS256", ...
|
|
89
|
+
expected_key_ref: "ml-dsa-65-spki-sha256:..." // the fingerprint you already trust (optional)
|
|
90
|
+
});
|
|
91
|
+
// result.signature_valid => the signature verifies under the supplied key
|
|
92
|
+
// result.signing_key_ref => "ml-dsa-65-spki-sha256:..." fingerprint of that key
|
|
93
|
+
// result.trust_anchored => signature_valid AND the key matches expected_key_ref
|
|
94
|
+
```
|
|
79
95
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`proof.verify-signature` / `proof.verify-bundle` / `proof.verify-envelope` / `proof.verify-receipt`);
|
|
83
|
-
xytara routes to xoonya's bearer-authed `/execute`, which runs real verification and returns the
|
|
84
|
-
verdict. It is billed only on a successful verification.
|
|
96
|
+
`verifyJws(compactJws, { trusted_public_key, expected_key_ref })` verifies a compact JWS the same
|
|
97
|
+
way; `alg: "none"`, `crit` extensions and unencoded payloads are rejected.
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
## CLI
|
|
87
100
|
|
|
88
101
|
```bash
|
|
89
|
-
|
|
102
|
+
xoonya start-here # the shortest verification path
|
|
103
|
+
xoonya first-run --verify-native --pretty # run the shipped vectors, print a JSON verdict
|
|
104
|
+
xoonya conformance --json # conformance + adversarial vectors, full summary
|
|
105
|
+
xoonya verify ./proof-bundle.json --pretty # verify one bundle; add --strict; exit 1 if invalid
|
|
90
106
|
```
|
|
91
107
|
|
|
92
|
-
|
|
108
|
+
`xoonya release` and `xoonya review` are operator tooling of the hosted service and are not part
|
|
109
|
+
of this package.
|
|
93
110
|
|
|
94
|
-
|
|
95
|
-
digest and structural results are rejected.
|
|
96
|
-
- `XOONYA_ACCEPT_PRIVATE_KEY_MATERIAL=false` — refuse private-key material on shared deployments;
|
|
97
|
-
sign locally with the SDK/CLI instead.
|
|
111
|
+
## Conformance
|
|
98
112
|
|
|
99
|
-
|
|
113
|
+
`vectors/` ships the conformance and adversarial vectors the hosted engine is tested against
|
|
114
|
+
(eleven verification methods, fifteen rejection cases, XNYA atom and payload-profile vectors).
|
|
115
|
+
`xoonya.verifyVectors()` runs them in-process and returns the summary. The same vectors are run by
|
|
116
|
+
both the hosted engine and this verifier before every release, and every result must be identical.
|
|
100
117
|
|
|
101
|
-
##
|
|
118
|
+
## Honest claims
|
|
102
119
|
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
120
|
+
- **Post-quantum means machine-evidence verification.** A `verified_native_hybrid_signature`
|
|
121
|
+
verdict says the proof was signed by the carried Ed25519 and ML-DSA-65 keys. It is not an
|
|
122
|
+
identity, custody, settlement, transport-security or chain-finality claim.
|
|
123
|
+
- **Proven suites:** Ed25519 and Ed25519 + ML-DSA-65 are exercised by the shipped vectors and by a
|
|
124
|
+
live paid verification on Base mainnet through the naxytra runtime. secp256k1, P-256 and
|
|
125
|
+
SLH-DSA are implemented suites but are not covered by shipped vectors.
|
|
126
|
+
- **Digest and anchored methods prove integrity, not authorship.** Anyone can produce a valid
|
|
127
|
+
digest; anchor refs are bound, not checked against the external chain or provider.
|
|
128
|
+
- **Trust in a signing key is yours to declare.** A key carried inside a proof, or supplied in the
|
|
129
|
+
same request, is never treated as trusted by itself.
|
|
108
130
|
|
|
109
131
|
## License
|
|
110
132
|
|
|
111
|
-
Apache-2.0
|
|
133
|
+
The verifier SDK is Apache-2.0 (see `LICENSE` and `NOTICE`). The hosted xoonya proof engine and
|
|
134
|
+
server are proprietary.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
`xoonya` 3.1
|
|
1
|
+
`xoonya` 3.2.1 is a synchronized-line release with no change to the verifier package contents, vectors or verification behavior. It is published through npm trusted publishing (GitHub OIDC), with no npm token involved.
|
package/START_HERE.md
CHANGED
|
@@ -1,159 +1,63 @@
|
|
|
1
1
|
# xoonya Start Here
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`xoonya` on npm is the **verifier** for xoonya proofs and naxytra delivery evidence. The proof
|
|
4
|
+
engine and server are a hosted service (https://xoonya.onrender.com); this package is the
|
|
5
|
+
verifier. The engine is not distributed.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
The product-side implementation, proof posture, and bounded hybrid verification work for the widened `3.0.0` finish line are now complete. The remaining step is the synchronized public `3.0.0` release cut, publish, deploy, and verification sequence documented in NAXYTRA_3_0_0_RELEASE_CONTRACT.md and PUBLISH_PLAN.md.
|
|
8
|
-
|
|
9
|
-
If you are arriving from the broader public discovery layer, the canonical entry points are:
|
|
7
|
+
If you are arriving from the public discovery layer, the canonical entry points are:
|
|
10
8
|
|
|
9
|
+
- https://www.naxytra.com/xoonya
|
|
11
10
|
- https://www.naxytra.com/agents
|
|
12
|
-
- https://www.naxytra.com/v1/
|
|
13
|
-
- https://www.naxytra.com/.well-known/agent.json
|
|
14
|
-
|
|
15
|
-
## 1. Understand The Role
|
|
16
|
-
|
|
17
|
-
`xoonya` is the proof-side half of the public stack.
|
|
18
|
-
|
|
19
|
-
Its job is to let a caller:
|
|
11
|
+
- https://www.naxytra.com/v1/first-run-kit
|
|
20
12
|
|
|
21
|
-
1.
|
|
22
|
-
2. inspect review and run posture
|
|
23
|
-
3. emit proof-native completion artifacts
|
|
24
|
-
4. verify the final proof bundle
|
|
13
|
+
## 1. The role
|
|
25
14
|
|
|
26
|
-
|
|
15
|
+
The public spine is `quote -> pay/credits -> execute -> prove -> verify`. The naxytra runtime
|
|
16
|
+
(`xytara`) owns quotes, payment and execution; the hosted xoonya engine emits the proof; this
|
|
17
|
+
package lets you verify that proof anywhere, offline, deterministically.
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
https://www.naxytra.com/v1/first-run-kit
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Then run the local proof followthrough:
|
|
19
|
+
## 2. Install and run the shipped vectors
|
|
33
20
|
|
|
34
21
|
```bash
|
|
22
|
+
npm install xoonya
|
|
23
|
+
xoonya start-here
|
|
35
24
|
xoonya first-run --verify-native --pretty
|
|
25
|
+
xoonya conformance --json
|
|
36
26
|
```
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
GET /v1/proof-truth
|
|
42
|
-
GET /v1/proof-truth/summary
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If you want the frozen machine-readable proof default-path contract behind that flow, inspect:
|
|
28
|
+
`first-run --verify-native` must print `"ok": true` and `"required_native_methods_present": true`.
|
|
29
|
+
The verification methods include `xoonya-native-sha256-v1`, `xoonya-native-signed-v1`,
|
|
30
|
+
`xoonya-native-hybrid-v1` (Ed25519 + ML-DSA-65) and `xoonya-native-anchored-v1`.
|
|
46
31
|
|
|
47
|
-
|
|
48
|
-
GET /v1/default-path
|
|
49
|
-
GET /v1/default-path/summary
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
If you want the frozen machine-readable followthrough claim boundary behind that flow, inspect:
|
|
53
|
-
|
|
54
|
-
```text
|
|
55
|
-
GET /v1/followthrough-truth
|
|
56
|
-
GET /v1/followthrough-truth/summary
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 2. Run The Fastest Real Example
|
|
60
|
-
|
|
61
|
-
Run:
|
|
32
|
+
## 3. Verify a real bundle
|
|
62
33
|
|
|
63
34
|
```bash
|
|
64
|
-
|
|
35
|
+
xoonya verify ./proof-bundle.json --pretty # exit 0 if valid, 1 otherwise
|
|
36
|
+
xoonya verify ./proof-bundle.json --strict --pretty # only cryptographically verified methods pass
|
|
65
37
|
```
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
If you want the clearest cross-repo adoption path instead of the broad package tour, continue with:
|
|
39
|
+
Or in code:
|
|
70
40
|
|
|
71
|
-
|
|
41
|
+
```js
|
|
42
|
+
const xoonya = require("xoonya");
|
|
43
|
+
const result = xoonya.verifyNativeBundle(bundle, { strict: true, trusted_public_key_refs: { ... } });
|
|
44
|
+
```
|
|
72
45
|
|
|
73
|
-
|
|
46
|
+
For detached signatures (including ML-DSA) use `xoonya.verifyDetachedSignature(...)`; for compact
|
|
47
|
+
JWS use `xoonya.verifyJws(...)`. See `README.md` for the option model.
|
|
74
48
|
|
|
75
|
-
|
|
76
|
-
- PUBLIC_DEMO_SCRIPT.md
|
|
77
|
-
- EXAMPLE_PATHS.md
|
|
78
|
-
- `node examples/partner_proof_walkthrough.js`
|
|
49
|
+
## 4. Read the boundary
|
|
79
50
|
|
|
80
|
-
|
|
51
|
+
- A valid result proves binding and signature validity under the carried key, not identity,
|
|
52
|
+
custody, settlement or external chain truth.
|
|
53
|
+
- Digest and anchored methods prove integrity and replayability, not authorship.
|
|
54
|
+
- Trust in a signing key is declared by you (`expected_key_ref`, `trusted_public_key_refs`).
|
|
81
55
|
|
|
82
|
-
|
|
56
|
+
## 5. Hosted surfaces
|
|
83
57
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
58
|
+
- https://xoonya.onrender.com/v1/proof-center/native-standard/summary
|
|
59
|
+
- https://xoonya.onrender.com/v1/proof-center/native-conformance-mark/summary
|
|
60
|
+
- https://xoonya.onrender.com/v1/proof-center/native-anchor-profile/summary
|
|
87
61
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## 4. Read The Durable Contract
|
|
91
|
-
|
|
92
|
-
For long-term product understanding, read:
|
|
93
|
-
|
|
94
|
-
- FINAL_CONTRACT.md
|
|
95
|
-
- SERVICE_CONTRACT.md
|
|
96
|
-
- `GET /openapi.json`
|
|
97
|
-
- `GET /asyncapi.json`
|
|
98
|
-
- `GET /cloudevents.json`
|
|
99
|
-
- `GET /v1/auth-profiles`
|
|
100
|
-
- `GET /v1/identity-interop`
|
|
101
|
-
- `GET /v1/providers`
|
|
102
|
-
- `GET /v1/frameworks`
|
|
103
|
-
- `GET /v1/integration-matrix`
|
|
104
|
-
- `GET /v1/telemetry`
|
|
105
|
-
- `GET /v1/provenance`
|
|
106
|
-
- `GET /v1/artifact-distribution`
|
|
107
|
-
- `GET /v1/shared-signals`
|
|
108
|
-
- `GET /v1/feature-control`
|
|
109
|
-
- `GET /v1/adapter-certification`
|
|
110
|
-
- `GET /v1/trust-portability-boundary`
|
|
111
|
-
- `GET /v1/signed-audit-provenance`
|
|
112
|
-
- `GET /v1/major-rails`
|
|
113
|
-
- `GET /v1/treasury`
|
|
114
|
-
- `GET /v1/erc8004`
|
|
115
|
-
- `GET /v1/proof-bridge`
|
|
116
|
-
- `GET /v1/external-proof-import`
|
|
117
|
-
- `GET /v1/result-package-trust`
|
|
118
|
-
- `GET /v1/event-systems`
|
|
119
|
-
- `GET /v1/integrations`
|
|
120
|
-
- PROGRAM_STATUS.md
|
|
121
|
-
- OPERATOR_START_HERE.md
|
|
122
|
-
- OPERATIONS_RUNBOOK.md
|
|
123
|
-
- PROGRAM_COMPLETE_RELEASE.md
|
|
124
|
-
- WHY_XYTARA_XOONYA.md
|
|
125
|
-
- CARRIED_HANDOFF_DEMO.md
|
|
126
|
-
- PARTNER_READY_PATH.md
|
|
127
|
-
- TERMINOLOGY.md
|
|
128
|
-
|
|
129
|
-
## 5. If You Are Integrating From Outside
|
|
130
|
-
|
|
131
|
-
Continue with:
|
|
132
|
-
|
|
133
|
-
- CROSS_RUNTIME_POSTURE.md
|
|
134
|
-
- integrations/PROOF_INTEGRATION_PROCESS.md
|
|
135
|
-
- PARTNER_READY_PATH.md
|
|
136
|
-
- COMPATIBILITY_NOTE.md
|
|
137
|
-
|
|
138
|
-
## 6. Production Reading Rule
|
|
139
|
-
|
|
140
|
-
If you only remember one thing, remember this:
|
|
141
|
-
|
|
142
|
-
The main public path is no longer "understand every proof helper first."
|
|
143
|
-
|
|
144
|
-
It is:
|
|
145
|
-
|
|
146
|
-
receive handoff -> inspect review posture -> confirm run posture -> emit and verify proof
|
|
147
|
-
|
|
148
|
-
If you want the shortest CLI-first read of the package after install, use:
|
|
149
|
-
|
|
150
|
-
- `xoonya start-here`
|
|
151
|
-
- `xoonya release --summary`
|
|
152
|
-
- `xoonya review --help`
|
|
153
|
-
|
|
154
|
-
## 7. If You Are Operating The Closed Program
|
|
155
|
-
|
|
156
|
-
Use:
|
|
157
|
-
|
|
158
|
-
- PROGRAM_STATUS.md
|
|
159
|
-
- OPERATOR_START_HERE.md
|
|
62
|
+
`xoonya release` and `xoonya review` belong to the hosted service's operator tooling and are not
|
|
63
|
+
part of this package.
|
package/bin/xoonya-first-run.js
CHANGED
|
@@ -29,8 +29,9 @@ function buildLocalGuide() {
|
|
|
29
29
|
product: "xoonya",
|
|
30
30
|
category: "xoonya-first-run-proof-guide",
|
|
31
31
|
guide_version: "xoonya-first-run-proof-guide-v1",
|
|
32
|
+
package_role: "verifier",
|
|
32
33
|
public_command_kit_url: DEFAULT_KIT_URL,
|
|
33
|
-
role: "
|
|
34
|
+
role: "proof_verification_after_xytara_runtime_execution",
|
|
34
35
|
safe_local_verification_command: "xoonya first-run --verify-native --pretty",
|
|
35
36
|
proof_modes: [
|
|
36
37
|
{
|
|
@@ -39,7 +40,11 @@ function buildLocalGuide() {
|
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
method: "xoonya-native-signed-v1",
|
|
42
|
-
verification: "
|
|
43
|
+
verification: "native_signature_ed25519_secp256k1_p256"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
method: "xoonya-native-hybrid-v1",
|
|
47
|
+
verification: "classical_plus_pq_signature_ed25519_ml_dsa_65"
|
|
43
48
|
},
|
|
44
49
|
{
|
|
45
50
|
method: "xoonya-native-anchored-v1",
|
|
@@ -58,7 +63,8 @@ function buildLocalGuide() {
|
|
|
58
63
|
boundaries: [
|
|
59
64
|
"xoonya_verifies_proof_bundles_and_native_method_binding",
|
|
60
65
|
"xoonya_anchor_binding_does_not_claim_external_provider_or_chain_truth",
|
|
61
|
-
"xytara_owns_runtime_payment_and_execution_state"
|
|
66
|
+
"xytara_owns_runtime_payment_and_execution_state",
|
|
67
|
+
"the_proof_engine_is_a_hosted_service_and_is_not_distributed"
|
|
62
68
|
]
|
|
63
69
|
};
|
|
64
70
|
}
|
|
@@ -80,12 +86,12 @@ function printUsage() {
|
|
|
80
86
|
"Usage: xoonya first-run [options]",
|
|
81
87
|
"",
|
|
82
88
|
"Options:",
|
|
83
|
-
" --json Print the guided proof
|
|
89
|
+
" --json Print the guided proof verification object",
|
|
84
90
|
" --offline Do not fetch the public command kit",
|
|
85
91
|
" --verify-native Run local native/conformance verification",
|
|
86
92
|
" --pretty Pretty-print JSON output",
|
|
87
93
|
" --help Show this help message"
|
|
88
|
-
].join("\n"));
|
|
94
|
+
].join("\n") + "\n");
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
function runNativeVerification(args) {
|
|
@@ -107,6 +113,7 @@ function runNativeVerification(args) {
|
|
|
107
113
|
product: "xoonya",
|
|
108
114
|
category: "xoonya-first-run-native-verification",
|
|
109
115
|
verification_version: "xoonya-first-run-native-verification-v1",
|
|
116
|
+
package_role: "verifier",
|
|
110
117
|
proof_bundle_conformance_passed: summary.ok === true,
|
|
111
118
|
conformance_count: summary.conformance_count,
|
|
112
119
|
adversarial_count: summary.adversarial_count,
|
|
@@ -114,6 +121,8 @@ function runNativeVerification(args) {
|
|
|
114
121
|
native_atom_adversarial_count: summary.native_atom_adversarial_count,
|
|
115
122
|
verification_methods: summary.verification_methods,
|
|
116
123
|
native_atom_error_codes: summary.native_atom_error_codes,
|
|
124
|
+
external_signature_checks: summary.external_signature_checks,
|
|
125
|
+
engine_parity: summary.engine_parity,
|
|
117
126
|
required_native_methods_present: [
|
|
118
127
|
"xoonya-native-sha256-v1",
|
|
119
128
|
"xoonya-native-signed-v1",
|
|
@@ -158,24 +167,27 @@ async function main() {
|
|
|
158
167
|
process.stdout.write([
|
|
159
168
|
"xoonya first-run",
|
|
160
169
|
"",
|
|
161
|
-
"
|
|
170
|
+
"Local proof verification after xytara execution:",
|
|
162
171
|
" xoonya first-run --verify-native --pretty",
|
|
172
|
+
" xoonya verify ./proof-bundle.json --pretty",
|
|
163
173
|
"",
|
|
164
174
|
"Inspect the public command kit:",
|
|
165
175
|
` ${DEFAULT_KIT_URL}`,
|
|
166
176
|
"",
|
|
167
|
-
"Native proof
|
|
177
|
+
"Native proof methods checked locally:",
|
|
168
178
|
" xoonya-native-sha256-v1",
|
|
169
179
|
" xoonya-native-signed-v1",
|
|
180
|
+
" xoonya-native-hybrid-v1",
|
|
170
181
|
" xoonya-native-anchored-v1",
|
|
171
182
|
"",
|
|
172
|
-
"
|
|
183
|
+
"Hosted proof surfaces:",
|
|
173
184
|
" https://xoonya.onrender.com/v1/proof-center/native-standard/summary",
|
|
174
185
|
" https://xoonya.onrender.com/v1/proof-center/native-anchor-profile/summary",
|
|
175
186
|
"",
|
|
176
187
|
"Boundary:",
|
|
177
|
-
" xoonya verifies proof and anchor binding; external chain/provider truth stays external."
|
|
178
|
-
|
|
188
|
+
" xoonya verifies proof and anchor binding; external chain/provider truth stays external.",
|
|
189
|
+
" The proof engine is a hosted service; this package is the verifier."
|
|
190
|
+
].join("\n") + "\n");
|
|
179
191
|
}
|
|
180
192
|
|
|
181
193
|
main().catch((error) => {
|
package/bin/xoonya.js
CHANGED
|
@@ -1,81 +1,113 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
const fs = require("fs");
|
|
4
5
|
const path = require("path");
|
|
5
6
|
const { spawnSync } = require("child_process");
|
|
6
7
|
|
|
8
|
+
const OPERATOR_TOOLING_MESSAGE = "Operator tooling is not part of the xoonya verifier package. See https://www.naxytra.com/xoonya";
|
|
9
|
+
|
|
7
10
|
function printUsage() {
|
|
8
11
|
process.stdout.write([
|
|
9
12
|
"Usage: xoonya <command> [options]",
|
|
10
13
|
"",
|
|
14
|
+
"xoonya verifier: checks xoonya proof bundles, native receipts, XNYA atoms and",
|
|
15
|
+
"detached signatures (Ed25519, ECDSA, RSA, ML-DSA). The proof engine is a hosted",
|
|
16
|
+
"service and is not part of this package.",
|
|
17
|
+
"",
|
|
11
18
|
"Commands:",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
" conformance Run proof conformance and adversarial vectors",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
" help Show this help message",
|
|
19
|
+
" start-here Print the shortest verification path",
|
|
20
|
+
" first-run [args] Guide or run local native verification",
|
|
21
|
+
" conformance [--json] Run proof conformance and adversarial vectors",
|
|
22
|
+
" verify <bundle.json> Verify a proof bundle file (--strict, --pretty)",
|
|
23
|
+
" help Show this help message",
|
|
18
24
|
"",
|
|
19
25
|
"Fastest first run:",
|
|
20
26
|
" xoonya start-here",
|
|
21
|
-
" xoonya first-run",
|
|
22
27
|
" xoonya first-run --verify-native --pretty",
|
|
23
|
-
" xoonya release --summary",
|
|
24
28
|
" xoonya conformance --json",
|
|
25
|
-
" xoonya
|
|
26
|
-
].join("\n"));
|
|
29
|
+
" xoonya verify ./proof-bundle.json --pretty"
|
|
30
|
+
].join("\n") + "\n");
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
function printStartHere() {
|
|
30
34
|
process.stdout.write([
|
|
31
35
|
"xoonya start-here",
|
|
32
36
|
"",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
37
|
+
"Role:",
|
|
38
|
+
" xoonya verifies proofs and naxytra delivery evidence. The proof engine and",
|
|
39
|
+
" server are a hosted service; this package is the verifier.",
|
|
40
|
+
"",
|
|
41
|
+
"Public spine:",
|
|
42
|
+
" quote -> pay/credits -> execute -> prove -> verify",
|
|
35
43
|
"",
|
|
36
44
|
"1. Open https://www.naxytra.com/v1/first-run-kit",
|
|
37
45
|
"2. Run the xytara quote-only command first; it needs no wallet secret.",
|
|
38
|
-
"3. After funded execution, verify the proof side:",
|
|
46
|
+
"3. After funded execution, verify the proof side locally:",
|
|
39
47
|
" xoonya first-run --verify-native --pretty",
|
|
40
|
-
" node examples/package_quickstart.js",
|
|
41
48
|
" xoonya conformance --json",
|
|
42
|
-
"
|
|
49
|
+
" xoonya verify ./proof-bundle.json --pretty",
|
|
50
|
+
"4. Inspect hosted proof surfaces:",
|
|
43
51
|
" https://xoonya.onrender.com/v1/proof-center/native-standard/summary",
|
|
44
52
|
" https://xoonya.onrender.com/v1/proof-center/native-conformance-mark/summary",
|
|
45
53
|
" https://xoonya.onrender.com/v1/proof-center/native-anchor-profile/summary",
|
|
46
54
|
"",
|
|
47
|
-
"Native proof
|
|
55
|
+
"Native proof methods verified locally:",
|
|
48
56
|
" xoonya-native-sha256-v1 replayable digest proof",
|
|
49
|
-
" xoonya-native-signed-v1 key-bound
|
|
57
|
+
" xoonya-native-signed-v1 key-bound signature proof (ed25519 / secp256k1 / p256)",
|
|
58
|
+
" xoonya-native-hybrid-v1 classical + post-quantum proof (ed25519 + ml-dsa-65)",
|
|
50
59
|
" xoonya-native-anchored-v1 anchor-binding proof",
|
|
51
60
|
"",
|
|
52
61
|
"Boundary:",
|
|
53
|
-
" xoonya verifies proof and
|
|
54
|
-
|
|
62
|
+
" xoonya verifies proof binding and signatures; identity, custody, settlement",
|
|
63
|
+
" and external chain/provider truth stay external.",
|
|
64
|
+
"",
|
|
65
|
+
"More: https://www.naxytra.com/xoonya"
|
|
66
|
+
].join("\n") + "\n");
|
|
55
67
|
}
|
|
56
68
|
|
|
57
|
-
function delegate(
|
|
58
|
-
const scriptPath = path.join(__dirname, scriptName);
|
|
69
|
+
function delegate(scriptPath, args) {
|
|
59
70
|
const result = spawnSync(process.execPath, [scriptPath, ...args], { stdio: "inherit" });
|
|
60
71
|
process.exitCode = typeof result.status === "number" ? result.status : 1;
|
|
61
72
|
}
|
|
62
73
|
|
|
74
|
+
function readBundleArg(args) {
|
|
75
|
+
const file = args.find((token) => !token.startsWith("--"));
|
|
76
|
+
if (!file) {
|
|
77
|
+
throw new Error("usage: xoonya verify <bundle.json> [--strict] [--pretty]");
|
|
78
|
+
}
|
|
79
|
+
const raw = file === "-" ? fs.readFileSync(0, "utf8") : fs.readFileSync(path.resolve(process.cwd(), file), "utf8");
|
|
80
|
+
return JSON.parse(raw);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function verifyBundleCommand(args) {
|
|
84
|
+
const verifier = require("../verify");
|
|
85
|
+
let result;
|
|
86
|
+
try {
|
|
87
|
+
const bundle = readBundleArg(args);
|
|
88
|
+
result = verifier.verifyProofBundle(bundle, { strict: args.includes("--strict") });
|
|
89
|
+
} catch (error) {
|
|
90
|
+
result = { valid: false, reason: error.message };
|
|
91
|
+
}
|
|
92
|
+
process.stdout.write(`${JSON.stringify(result, null, args.includes("--pretty") ? 2 : 0)}\n`);
|
|
93
|
+
process.exitCode = result.valid === true ? 0 : 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
63
96
|
const [command, ...rest] = process.argv.slice(2);
|
|
64
97
|
|
|
65
98
|
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
66
99
|
printUsage();
|
|
67
100
|
} else if (command === "start-here" || command === "--start-here") {
|
|
68
101
|
printStartHere();
|
|
69
|
-
} else if (command === "release") {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
delegate("xoonya-review.js", rest);
|
|
102
|
+
} else if (command === "release" || command === "review") {
|
|
103
|
+
process.stderr.write(`${OPERATOR_TOOLING_MESSAGE}\n`);
|
|
104
|
+
process.exitCode = 2;
|
|
73
105
|
} else if (command === "first-run" || command === "firstrun") {
|
|
74
|
-
delegate("xoonya-first-run.js", rest);
|
|
106
|
+
delegate(path.join(__dirname, "xoonya-first-run.js"), rest);
|
|
75
107
|
} else if (command === "conformance" || command === "verify-vectors") {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
108
|
+
delegate(path.join(__dirname, "..", "scripts", "verify_vectors.js"), rest);
|
|
109
|
+
} else if (command === "verify" || command === "verify-bundle") {
|
|
110
|
+
verifyBundleCommand(rest);
|
|
79
111
|
} else {
|
|
80
112
|
printUsage();
|
|
81
113
|
process.exitCode = 1;
|