xytara 1.26.0 → 2.0.0

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.
Files changed (38) hide show
  1. package/.env.example +20 -0
  2. package/BSV_TERANODE_SETUP.md +76 -0
  3. package/README.md +206 -5
  4. package/REAL_PAYMENT_SETUP.md +101 -0
  5. package/SERVICE_CONTRACT.md +197 -5
  6. package/START_HERE.md +2 -0
  7. package/adapters/AUTHORING_GUIDE.md +10 -0
  8. package/adapters/examples/example-third-party-acp-registration.submission-bundle.json +124 -0
  9. package/adapters/examples/example-third-party-erc8004-registration.submission-bundle.json +121 -0
  10. package/adapters/examples/example-third-party-langchain-registration.submission-bundle.json +124 -0
  11. package/adapters/examples/example-third-party-mpp-registration.submission-bundle.json +120 -0
  12. package/fixtures/catalog.js +107 -10
  13. package/index.js +1 -1
  14. package/integrations/dispatch.js +4 -3
  15. package/integrations/registry.js +240 -1
  16. package/lib/account_auth.js +172 -0
  17. package/lib/catalog_contract.js +48 -1
  18. package/lib/catalog_views.js +19 -0
  19. package/lib/command_flow.js +188 -1
  20. package/lib/commerce_artifacts.js +31 -1
  21. package/lib/commerce_cases.js +14 -0
  22. package/lib/commerce_checkout.js +347 -0
  23. package/lib/commerce_client.js +322 -57
  24. package/lib/commerce_coordination.js +346 -0
  25. package/lib/commerce_economics.js +1432 -0
  26. package/lib/commerce_quotes.js +29 -6
  27. package/lib/commerce_reports.js +123 -2
  28. package/lib/commerce_runtime.js +78 -23
  29. package/lib/commerce_shell.js +239 -0
  30. package/lib/external_credit_bridge.js +142 -0
  31. package/lib/payment_config.js +114 -0
  32. package/lib/payment_verification.js +244 -0
  33. package/lib/record_queries.js +1 -0
  34. package/lib/runtime_bridge.js +116 -0
  35. package/lib/settlement_bsv_live.js +258 -0
  36. package/lib/settlement_bsv_teranode.js +105 -0
  37. package/package.json +3 -1
  38. package/server.js +1240 -104
package/.env.example CHANGED
@@ -1,3 +1,23 @@
1
1
  XYTARA_HOST=127.0.0.1
2
2
  XYTARA_PORT=4320
3
3
  XYTARA_BASE_URL=http://127.0.0.1:4320
4
+ XYTARA_PAYMENT_VERIFICATION_MODE=presence
5
+ XYTARA_PAYMENT_MAX_AGE_SECONDS=300
6
+ XYTARA_WALLET_REGISTRY_JSON=[]
7
+ XYTARA_TREASURY_DESTINATION_ID=
8
+ XYTARA_TREASURY_DESTINATION_KIND=
9
+ XYTARA_TREASURY_ACCOUNT_ID=
10
+ XYTARA_TREASURY_EXTERNAL_REF=
11
+ XYTARA_TREASURY_DESTINATIONS_JSON={}
12
+ XYTARA_BSV_TERANODE_NETWORK=mainnet
13
+ XYTARA_BSV_TERANODE_RPC_URL=
14
+ XYTARA_BSV_TERANODE_MODE=opreturn
15
+ XYTARA_BSV_TERANODE_REQUIRED_CONFIRMATIONS=1
16
+ XYTARA_BSV_TERANODE_MERCHANT_ADDRESS=
17
+ XYTARA_BSV_TERANODE_MERCHANT_PAYMAIL=
18
+ XYTARA_BSV_TERANODE_MERCHANT_LABEL=naxytra-runtime
19
+ XYTARA_BSV_TERANODE_USE_METANET=false
20
+ XYTARA_BSV_TERANODE_SATS_PER_USD_CENT=100
21
+ XYTARA_BSV_TERANODE_SETTLEMENT_RUNTIME_MODE=mock
22
+ XYTARA_CREDIT_BRIDGE_BEARER_TOKEN=
23
+ XYTARA_ACCOUNT_AUTH_BEARER_TOKEN=
@@ -0,0 +1,76 @@
1
+ # BSV Teranode Setup
2
+
3
+ `xytara` now treats `bsv_teranode` as the native first-party settlement base for the default machine payment path.
4
+
5
+ Use this guide when you want the public package to emit BSV/Teranode-aware payment and settlement posture instead of only generic treasury bookkeeping.
6
+
7
+ ## What This Gives You
8
+
9
+ - quotes expose native `bsv_teranode` settlement hints
10
+ - signed payment payloads can carry BSV/Teranode merchant details and settlement reference data
11
+ - accepted payments and resulting receipts preserve BSV/Teranode settlement metadata
12
+ - treasury routing can point directly at a BSV/Teranode merchant address or paymail
13
+
14
+ This is still a runtime-side settlement contract, not a bundled bank or broadcaster. Real external custody still depends on the BSV/Teranode infrastructure you configure behind it.
15
+
16
+ ## Recommended Environment
17
+
18
+ ```env
19
+ XYTARA_PAYMENT_VERIFICATION_MODE=local_signed
20
+ XYTARA_BSV_TERANODE_NETWORK=mainnet
21
+ XYTARA_BSV_TERANODE_MODE=opreturn
22
+ XYTARA_BSV_TERANODE_REQUIRED_CONFIRMATIONS=1
23
+ XYTARA_BSV_TERANODE_MERCHANT_ADDRESS=
24
+ XYTARA_BSV_TERANODE_MERCHANT_PAYMAIL=
25
+ XYTARA_BSV_TERANODE_MERCHANT_LABEL=naxytra-runtime
26
+ XYTARA_BSV_TERANODE_USE_METANET=false
27
+ XYTARA_BSV_TERANODE_SATS_PER_USD_CENT=100
28
+ XYTARA_BSV_TERANODE_SETTLEMENT_RUNTIME_MODE=mock
29
+ ```
30
+
31
+ Optional:
32
+
33
+ - `XYTARA_BSV_TERANODE_RPC_URL`
34
+ - present when you have a Teranode-facing endpoint available and want the runtime to know that the live transport is configured
35
+
36
+ ## Merchant Destination Routing
37
+
38
+ If you set:
39
+
40
+ - `XYTARA_BSV_TERANODE_MERCHANT_ADDRESS`
41
+ or
42
+ - `XYTARA_BSV_TERANODE_MERCHANT_PAYMAIL`
43
+
44
+ then `xytara` can derive a BSV/Teranode treasury destination automatically for `bsv_teranode` settlement quotes.
45
+
46
+ If you need more explicit destination control, use:
47
+
48
+ - `XYTARA_TREASURY_DESTINATIONS_JSON`
49
+
50
+ with a `bsv_teranode` entry.
51
+
52
+ ## Runtime Behavior
53
+
54
+ For a native `bsv_teranode` quote:
55
+
56
+ - settlement mode defaults to `bsv_teranode`
57
+ - quote settlement hints include:
58
+ - rail
59
+ - network
60
+ - merchant address or paymail
61
+ - amount in satoshis
62
+ - settlement reference
63
+ - signed client payment payloads can carry the same BSV/Teranode hints back to the runtime
64
+ - resulting transactions/receipts preserve BSV/Teranode settlement metadata for later reconciliation and proof follow-through
65
+
66
+ For live settlement follow-through after payment acceptance, use:
67
+
68
+ - `GET /v1/settlement/bsv-teranode`
69
+ - `GET /v1/settlement/bsv-teranode/:settlement_id`
70
+ - `POST /v1/settlement/bsv-teranode/:settlement_id/submit`
71
+ - `POST /v1/settlement/bsv-teranode/:settlement_id/refresh`
72
+
73
+ ## Notes
74
+
75
+ - `bsv_teranode` is the canonical public settlement name
76
+ - Metanet remains optional support infrastructure, not a required dependency
package/README.md CHANGED
@@ -31,16 +31,125 @@ If you are building adapters, continue with:
31
31
  - [adapters/ONBOARDING_POSTURE.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/adapters/ONBOARDING_POSTURE.md)
32
32
  - [adapters/THIRD_PARTY_SUBMISSION_PROCESS.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/adapters/THIRD_PARTY_SUBMISSION_PROCESS.md)
33
33
 
34
+ If you are wiring the native BSV settlement base, continue with:
35
+
36
+ - [BSV_TERANODE_SETUP.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/BSV_TERANODE_SETUP.md)
37
+ - [REAL_PAYMENT_SETUP.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/REAL_PAYMENT_SETUP.md)
38
+
39
+ If you are wiring the first human checkout path, continue with:
40
+
41
+ - [HUMAN_CHECKOUT_AND_RUNTIME_BRIDGE_PATTERN.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/HUMAN_CHECKOUT_AND_RUNTIME_BRIDGE_PATTERN.md)
42
+ - [RUNTIME_BRIDGE_CONTRACT.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/RUNTIME_BRIDGE_CONTRACT.md)
43
+ - [HOSTED_CHECKOUT_CONTRACT.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/HOSTED_CHECKOUT_CONTRACT.md)
44
+ - [CHECKOUT_TO_CREDITS_AND_DISPATCH_PLAN.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/CHECKOUT_TO_CREDITS_AND_DISPATCH_PLAN.md)
45
+
34
46
  ## Production Path
35
47
 
36
48
  The intended production-facing default path is now:
37
49
 
38
50
  1. discover a capability
39
51
  2. preview or quote the transaction path
40
- 3. execute through the default machine path
41
- 4. inspect the transaction-side result and lifecycle state
42
- 5. hand the result into `xoonya`
43
- 6. review and run the proof-side completion path
52
+ 3. spend existing credits first when the caller prefers the reusable account path
53
+ 4. fall back to direct machine payment when credits are not available or not preferred
54
+ 5. execute through the default machine path
55
+ 6. inspect the transaction-side result and lifecycle state
56
+ 7. hand the result into `xoonya`
57
+ 8. review and run the proof-side completion path
58
+
59
+ The machine-facing execution surface now also supports a first-class reusable balance posture:
60
+
61
+ - set `payment_preference: "credits_first"` on `POST /v1/commands/execute` when the caller wants to spend existing account credits before requesting a fresh payment
62
+ - default spend posture is `open_spend`: if the funded caller can pay, `xytara` should spend and execute without extra runtime ceremony
63
+ - bounded spend posture is optional and only applies when the caller intentionally uses an `agent_id` and/or `budget_id`
64
+ - inspect account credit state with `GET /v1/economics/accounts/:account_id/credit-balance`
65
+ - inspect deterministic usage metering state with `GET /v1/economics/accounts/:account_id/metering-summary`, `GET /v1/economics/accounts/:account_id/usage-meters`, and `GET /v1/economics/accounts/:account_id/usage-meters/:usage_meter_id`
66
+ - expect reconciliation and operator-export surfaces to carry the same metering trail for audit visibility
67
+ - export a canonical cross-repo economic handoff bundle with `POST /v1/economics/handoff-bundles/economic-consequence`
68
+ - expect `POST /v1/transaction-center/result-packages/export` and result-package continuation export/prepare surfaces to auto-carry that same canonical economic bundle whenever the execution path spent credits and produced a deterministic usage meter
69
+ - inspect pack-backed entitlement pools with `GET /v1/economics/accounts/:account_id/entitlements` and `GET /v1/economics/accounts/:account_id/entitlements/summary`
70
+ - inspect low-balance and replenishment posture with `GET /v1/economics/accounts/:account_id/entitlements/replenishment-summary`
71
+ - inspect one pool’s replenishment view with `GET /v1/economics/accounts/:account_id/entitlements/:entitlement_id/replenishment-view`
72
+ - inspect effective account spend posture with `GET /v1/economics/accounts/:account_id/policy-pack`
73
+ - inspect effective agent spend posture with `GET /v1/economics/accounts/:account_id/agents/:agent_id/policy-view`
74
+ - preflight a proposed credit spend with `POST /v1/economics/rails/credits/preview-spend`
75
+ - record explicit bounded credit consumption with `POST /v1/economics/rails/credits/consume`
76
+ - issue externally verified top-up grants with `POST /v1/credit-bridge/grants`
77
+ - inspect externally issued grants with `GET /v1/credit-bridge/grants` and `GET /v1/credit-bridge/grants/:grant_id`
78
+ - discover reusable funding posture through `GET /v1/credit-packs`, `GET /v1/credit-packs/summary`, and `GET /v1/credit-pack?ref=<pack_id>`
79
+ - external grant callers can now fund a named public pack such as `credits.agent`, and `xytara` will validate and record that pack identity directly
80
+
81
+ The SDK now exposes the same posture directly for agent callers:
82
+
83
+ - `client.getCreditPackSummary()`
84
+ - `client.getCreditBalance(accountId)`
85
+ - `client.previewUsageMetering({ account_id, task_ref?, workflow_ref?, units? })`
86
+ - `client.getUsageMeteringSummary(accountId)`
87
+ - `client.listUsageMeters(accountId)`
88
+ - `client.getUsageMeter(usageMeterId, accountId?)`
89
+ - `client.exportEconomicConsequenceHandoffBundle({ account_id, usage_meter_id, credit_spend_id, meter_profile_ref? })`
90
+ - `client.listEntitlements(accountId)`
91
+ - `client.getEntitlementSummary(accountId)`
92
+ - `client.getEntitlement(entitlementId, accountId?)`
93
+ - `client.getEntitlementReplenishmentSummary(accountId)`
94
+ - `client.getEntitlementReplenishmentView(entitlementId, accountId?)`
95
+ - `client.updateEntitlementReplenishmentPreference(entitlementId, payload, accountId?)`
96
+ - `client.previewCreditSpend({ account_id, task_ref, units, agent_id?, budget_id? })`
97
+ - `client.getCreditSpendPolicyPack(accountId)`
98
+ - `client.getAgentCreditSpendPolicyView(agentId, accountId?)`
99
+ - `client.executeWithCreditsFirst(payload, options?)`
100
+
101
+ The runtime now also supports a bounded delegated spend path for repeat-use automation:
102
+
103
+ - issue a spend credential through `POST /v1/account-auth/spend-credentials`
104
+ - use that credential as `authorization: Bearer <spend_credential>`
105
+ - optionally bind the credential to a `pack_id` or `entitlement_id` when spend should stay inside one value pool
106
+ - execute through the same `credits_first` path without sharing broad operator secrets
107
+ - revoke it through `POST /v1/account-auth/spend-credentials/:credential_id/revoke`
108
+
109
+ SDK helpers now include:
110
+
111
+ - `client.createSpendCredential(payload, { bearerToken })`
112
+ - `client.listSpendCredentials(filters?, { bearerToken? })`
113
+ - `client.getSpendCredential(credentialId, { bearerToken? })`
114
+ - `client.revokeSpendCredential(credentialId, payload, { bearerToken })`
115
+ - `client.executeWithSpendCredential(payload, { spendToken })`
116
+
117
+ This keeps one-off usage and repeat usage on the same public spine:
118
+
119
+ - direct pay when the caller is using the stack once
120
+ - credit balance when the caller is already funded and wants low-friction repeat execution
121
+ - optional agent and budget controls can still bound that spend without changing the execution surface
122
+
123
+ It also keeps the human checkout boundary clean:
124
+
125
+ - an external merchant-facing system can verify a purchase and issue a bounded credit grant into `xytara`
126
+ - `xytara` records the granted value and consumes it during later runtime operations
127
+ - the runtime does not need to absorb provider-specific checkout semantics to support repeat usage
128
+ - in production, `POST /v1/credit-bridge/grants` should normally be protected with `XYTARA_CREDIT_BRIDGE_BEARER_TOKEN`
129
+
130
+ The first human-facing convenience path now follows a parallel narrow route:
131
+
132
+ 1. create hosted purchase intent
133
+ 2. create checkout session
134
+ 3. normalize payment success
135
+ 4. issue credits or entitlement
136
+ 5. dispatch through the runtime bridge when needed
137
+ 6. converge back into the same `xytara` and `xoonya` spine
138
+
139
+ The first direct hosted execution path now also has a public runtime bridge surface:
140
+
141
+ - `POST /v1/runtime-bridge/dispatch`
142
+ - `GET /v1/runtime-bridge/dispatches`
143
+ - `GET /v1/runtime-bridge/dispatches/:request_id`
144
+
145
+ The hosted payment side is intentionally asymmetric:
146
+
147
+ - pay-in should be simple and fast
148
+ - execution and delivery should follow immediately after valid payment
149
+ - refund or reversal requests should enter review first
150
+ - no autonomous payout path should exist outside explicit operator review and completion
151
+
152
+ The operator shell now also carries hosted checkout visibility so purchase, dispatch, and refund-review load can be monitored from the same public control surface.
44
153
 
45
154
  The rest of this README explains the full surface area and milestone trail, but the public starting posture should now be understandable from that one default path.
46
155
 
@@ -98,7 +207,7 @@ The package and service also expose a default transaction center surface so the
98
207
 
99
208
  - default protocol lane: `mcp`
100
209
  - default payment protocol: `x402`
101
- - default settlement center: built-in chain settlement across the canonical bundled settlement modes
210
+ - default settlement center: built-in chain settlement with `bsv_teranode` as the native default across the canonical bundled settlement modes
102
211
  - default treasury landing posture: account treasury destination by settlement mode
103
212
 
104
213
  That same default center is also reflected in direct helper paths for default MCP usage, so the default path can be previewed or quoted without repeating the full integration-selection story each time.
@@ -560,6 +669,13 @@ Environment example:
560
669
 
561
670
  - [`.env.example`](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/.env.example)
562
671
 
672
+ Production payment note:
673
+
674
+ - set `XYTARA_PAYMENT_VERIFICATION_MODE=local_signed` to enforce verifiable signed payment acceptance instead of plain header presence
675
+ - provide buyer wallet verification material through `XYTARA_WALLET_REGISTRY_JSON` or `XYTARA_WALLET_REGISTRY_PATH`
676
+ - set `XYTARA_TREASURY_DESTINATION_ID` and related treasury env vars so accepted payments land in your merchant treasury posture instead of the default local account placeholder
677
+ - built-in `x402` is the admission lane; real external payout/custody still depends on the payment rail and treasury destination you configure behind that lane
678
+
563
679
  Primary service routes:
564
680
 
565
681
  - `GET /health`
@@ -606,6 +722,24 @@ Primary service routes:
606
722
  - `POST /v1/registry/packs/anchor`
607
723
  - `POST /v1/anchoring/submit`
608
724
  - `POST /v1/anchoring/packs/preview`
725
+ - `GET /v1/coordination-center`
726
+ - `GET /v1/coordination-center/summary`
727
+ - `GET /v1/zones`
728
+ - `GET /v1/zones/compatibility-profiles`
729
+ - `GET /v1/zones/:zoneId/constitution`
730
+ - `POST /v1/coordination-center/interpretation-handoff/validate`
731
+ - `POST /v1/coordination-center/handshake-preview`
732
+ - `POST /v1/coordination-center/cross-zone-preview`
733
+ - `POST /v1/coordination-center/admission-case-projection`
734
+ - `POST /v1/coordination-center/admission-case-bundle`
735
+ - `POST /v1/coordination-center/operator-view`
736
+ - `POST /v1/coordination-center/admin-view`
737
+ - `POST /v1/coordination-center/admission-ops-pack`
738
+ - `POST /v1/coordination-center/admission-workflow-pack`
739
+ - `POST /v1/coordination-center/coordination-pack`
740
+ - `POST /v1/coordination-center/review-link`
741
+ - `GET /v1/coordination-center/zones-dashboard`
742
+ - `POST /v1/coordination-center/zones-dashboard-pack`
609
743
  - `POST /v1/mcp/tools/invoke`
610
744
  - `GET /v1/payment-quotes`
611
745
  - `GET /v1/payment-quotes/:quote_id`
@@ -636,6 +770,73 @@ Primary service routes:
636
770
  - `GET /v1/operator-export-pack`
637
771
  - `GET /v1/operations/dashboard`
638
772
  - `GET /v1/operations/attention-records`
773
+ - `GET /v1/operator-shell`
774
+ - `GET /v1/operator-shell/summary`
775
+ - `POST /v1/operator-shell/summary`
776
+ - `POST /v1/operator-shell/workflow-pack`
777
+ - `POST /v1/operator-shell/admin-pack`
778
+ - `GET /v1/agent-accounts`
779
+ - `POST /v1/agent-accounts`
780
+ - `GET /v1/agent-accounts/:account_id`
781
+ - `POST /v1/economics/budgets`
782
+ - `POST /v1/economics/budgets/:budget_id/status`
783
+ - `POST /v1/economics/agents`
784
+ - `POST /v1/economics/agents/:agent_id/status`
785
+ - `POST /v1/economics/receipts`
786
+ - `POST /v1/economics/receipts/:receipt_id/lifecycle`
787
+ - `POST /v1/economics/receipts/:receipt_id/operator-action`
788
+ - `POST /v1/economics/allocations/mint`
789
+ - `POST /v1/economics/allocations/reverse`
790
+ - `POST /v1/economics/rails/credits/preview`
791
+ - `POST /v1/economics/rails/credits/apply`
792
+ - `POST /v1/economics/receipt-ledger/validate`
793
+ - `POST /v1/economics/interpretation-handoff`
794
+ - `POST /v1/economics/markets/preview`
795
+ - `POST /v1/economics/markets/workflow-pack`
796
+ - `POST /v1/economics/markets/signoff-pack`
797
+ - `POST /v1/economics/markets/coordination-pack`
798
+ - `GET /v1/economics/accounts/:account_id/budgets`
799
+ - `GET /v1/economics/accounts/:account_id/agents`
800
+ - `GET /v1/economics/accounts/:account_id/receipts`
801
+ - `GET /v1/economics/accounts/:account_id`
802
+ - `GET /v1/economics/accounts/:account_id/operator-view`
803
+ - `GET /v1/economics/accounts/:account_id/operator-dashboard`
804
+ - `GET /v1/economics/accounts/:account_id/treasury-summary`
805
+ - `GET /v1/economics/accounts/:account_id/ledger-export`
806
+ - `GET /v1/economics/accounts/:account_id/treasury-drilldown`
807
+ - `GET /v1/economics/accounts/:account_id/reconciliation-pack`
808
+ - `GET /v1/economics/accounts/:account_id/treasury-workflow-pack`
809
+ - `GET /v1/economics/accounts/:account_id/treasury-signoff-pack`
810
+ - `GET /v1/economics/accounts/:account_id/policy-summary`
811
+ - `GET /v1/economics/accounts/:account_id/rail-summary`
812
+ - `GET /v1/economics/accounts/:account_id/rail-workflow-pack`
813
+ - `GET /v1/economics/accounts/:account_id/rail-signoff-pack`
814
+ - `POST /v1/economics/jobs/:job_id/operator-action`
815
+ - `GET /v1/economics/evidence/receipts/:receipt_ref`
816
+ - `GET /v1/economics/evidence/jobs/:job_id`
817
+ - `GET /v1/economics/integration/jobs/:job_id`
818
+
819
+ The Wave C coordination carry-over line adds a bounded coordination center on top of the public transaction spine:
820
+
821
+ - zone discovery, compatibility profiles, and constitution lookup
822
+ - interpretation-handoff validation and cross-zone handshake preview
823
+ - cross-zone admission-case projection and portable case-bundle export
824
+ - coordination operator/admin views plus explicit review-linkage into governance and proof follow-through
825
+ - admission ops/workflow packs, coordination packs, and zones dashboard packaging
826
+
827
+ The Wave D adapter-breadth line broadens the bundled public integration surface as well:
828
+
829
+ - additional built-in protocol surfaces for `a2a`, `acp`, `mqtt`, `grpc`, `kafka`, `nats`, and `ros2`
830
+ - additional built-in execution-front surfaces for `langchain`, `langgraph`, `semantic_kernel`, `autogen`, `crewai`, and `llamaindex`
831
+ - broader bundled payment and identity breadth through `mpp` and `erc8004`-oriented public integration surfaces
832
+
833
+ The Wave F shell carry-over line adds a bounded operator shell inside public `xytara`:
834
+
835
+ - self-serve agent account issuance for the public runtime path
836
+ - a unified operator shell summary across operations, economics, and coordination
837
+ - compact workflow/admin shell exports that point cleanly into proof-side follow-through when needed
838
+
839
+ This keeps the public product centered on `naxytra` while recovering the useful operator-shell lineage as a built-in `xytara` capability instead of a separate branded surface.
639
840
 
640
841
  ## Verification
641
842
 
@@ -0,0 +1,101 @@
1
+ # Real Payment Setup
2
+
3
+ This guide explains how to move `xytara` from local placeholder payment acceptance into a production-usable payment posture.
4
+
5
+ ## What Changed
6
+
7
+ `xytara` now supports two payment-acceptance modes:
8
+
9
+ - `presence`
10
+ - development/demo mode
11
+ - payment headers are required, but not cryptographically verified
12
+
13
+ - `local_signed`
14
+ - production-oriented built-in mode
15
+ - signed payment payloads are cryptographically verified against a configured wallet registry
16
+ - quote replay and nonce replay are blocked
17
+ - accepted payments are routed into your configured merchant treasury destination posture
18
+
19
+ ## Minimum Production-Oriented Configuration
20
+
21
+ Set these environment variables:
22
+
23
+ ```env
24
+ XYTARA_PAYMENT_VERIFICATION_MODE=local_signed
25
+ XYTARA_PAYMENT_MAX_AGE_SECONDS=300
26
+ XYTARA_WALLET_REGISTRY_JSON=[{"wallet_id":"<wallet-id>","secret":"<shared-secret>","account_id":"<account-id>"}]
27
+ XYTARA_TREASURY_DESTINATION_ID=merchant_treasury_primary
28
+ XYTARA_TREASURY_DESTINATION_KIND=merchant_treasury
29
+ XYTARA_TREASURY_ACCOUNT_ID=merchant-main
30
+ XYTARA_TREASURY_EXTERNAL_REF=merchant-usd-main
31
+ ```
32
+
33
+ You can also load the wallet registry and treasury map from files through:
34
+
35
+ - `XYTARA_WALLET_REGISTRY_PATH`
36
+ - `XYTARA_TREASURY_DESTINATIONS_PATH`
37
+
38
+ ## What This Gives You
39
+
40
+ With `local_signed` enabled:
41
+
42
+ - `POST /x402/commands/execute` challenges for payment
43
+ - the client signs the exact payment payload
44
+ - if the quote is using native `bsv_teranode`, the payment payload can also carry BSV/Teranode merchant and settlement-reference hints
45
+ - the server verifies:
46
+ - wallet registration
47
+ - HMAC signature validity
48
+ - quote id
49
+ - amount
50
+ - currency
51
+ - settlement binding
52
+ - timestamp freshness
53
+ - nonce uniqueness
54
+ - accepted payments are recorded into:
55
+ - `payment-ledger`
56
+ - `treasury-summary`
57
+ - `rail-summary`
58
+ - `reconciliation-report`
59
+
60
+ ## What It Does Not Do By Itself
61
+
62
+ The built-in path gives you verifiable payment acceptance and merchant treasury routing posture inside `xytara`.
63
+
64
+ It does not by itself:
65
+
66
+ - move fiat into a bank account
67
+ - broadcast on-chain settlement
68
+ - replace an external processor or custodian
69
+
70
+ For actual external custody, connect `xytara` to the real rail you want behind the payment and settlement boundary.
71
+
72
+ That is where:
73
+
74
+ - your payment rail integration
75
+ - your settlement integration
76
+ - your merchant treasury destination
77
+
78
+ become the actual real-world landing point for accepted funds.
79
+
80
+ ## Best Current Public Model
81
+
82
+ Use the stack like this:
83
+
84
+ - `x402` route = payment admission lane
85
+ - `local_signed` = real verifiable acceptance posture in the public package
86
+ - `bsv_teranode` = native first-party settlement base when you want the public stack to expose BSV/Teranode-aware payout posture
87
+ - configured treasury destination = merchant-facing landing posture in the runtime
88
+ - external rail / settlement integration = actual custody and payout layer
89
+
90
+ If you want the native BSV path specifically, continue with [BSV_TERANODE_SETUP.md](C:/Users/Yoga/Desktop/workspace/vscode_workspace_public/naxytra/xytara/BSV_TERANODE_SETUP.md).
91
+
92
+ ## Operator Visibility
93
+
94
+ After acceptance, inspect:
95
+
96
+ - `GET /v1/payment-ledger`
97
+ - `GET /v1/economics/accounts/:account_id/treasury-summary`
98
+ - `GET /v1/economics/accounts/:account_id/rail-summary`
99
+ - `GET /v1/reconciliation-report`
100
+
101
+ These tell you what was accepted, where it was routed in the runtime model, and what still needs reconciliation against the underlying real-world rail.