@sparkysolutions/agentrail 0.0.0-stage โ 0.1.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/LICENSE +21 -0
- package/README.md +249 -3
- package/dist/cli/mcp-stdio.d.ts +8 -0
- package/dist/cli/mcp-stdio.js +454 -0
- package/dist/cli/pipeline.d.ts +40 -0
- package/dist/cli/pipeline.js +114 -0
- package/dist/cli/sandbox.d.ts +55 -0
- package/dist/cli/sandbox.js +107 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +39 -0
- package/dist/lib/agent-badge-issuer.d.ts +36 -0
- package/dist/lib/agent-badge-issuer.js +166 -0
- package/dist/lib/agent-registry.d.ts +136 -0
- package/dist/lib/agent-registry.js +124 -0
- package/dist/lib/agenthustle-pipeline.d.ts +68 -0
- package/dist/lib/agenthustle-pipeline.js +143 -0
- package/dist/lib/agentpass-pipeline.d.ts +44 -0
- package/dist/lib/agentpass-pipeline.js +84 -0
- package/dist/lib/audit-trail-provider.d.ts +24 -0
- package/dist/lib/audit-trail-provider.js +60 -0
- package/dist/lib/axis-clob-provider.d.ts +50 -0
- package/dist/lib/axis-clob-provider.js +150 -0
- package/dist/lib/circuit-breaker.d.ts +60 -0
- package/dist/lib/circuit-breaker.js +136 -0
- package/dist/lib/conditional-escrow.d.ts +42 -0
- package/dist/lib/conditional-escrow.js +126 -0
- package/dist/lib/mcp-server.d.ts +29 -0
- package/dist/lib/mcp-server.js +165 -0
- package/dist/lib/micro-stream.d.ts +21 -0
- package/dist/lib/micro-stream.js +41 -0
- package/dist/lib/proof-of-task.d.ts +12 -0
- package/dist/lib/proof-of-task.js +32 -0
- package/dist/lib/receipts.d.ts +153 -0
- package/dist/lib/receipts.js +173 -0
- package/dist/lib/reflector-oracle-adapter.d.ts +44 -0
- package/dist/lib/reflector-oracle-adapter.js +173 -0
- package/dist/lib/scoped-allowance.d.ts +15 -0
- package/dist/lib/scoped-allowance.js +116 -0
- package/dist/lib/ttl-keeper.d.ts +10 -0
- package/dist/lib/ttl-keeper.js +36 -0
- package/dist/lib/universal-adapters.d.ts +42 -0
- package/dist/lib/universal-adapters.js +69 -0
- package/dist/lib/x402-gateway.d.ts +86 -0
- package/dist/lib/x402-gateway.js +128 -0
- package/dist/lib/x402-pipeline.d.ts +51 -0
- package/dist/lib/x402-pipeline.js +105 -0
- package/dist/sdk/agent-client.d.ts +26 -0
- package/dist/sdk/agent-client.js +53 -0
- package/dist/types.d.ts +181 -0
- package/dist/types.js +5 -0
- package/glama.json +12 -0
- package/package.json +56 -6
- package/smithery.json +43 -0
- package/smithery.yaml +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SorobanAgents
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,249 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# AgentRail Protocol ๐ฐ๏ธ๐ค
|
|
2
|
+
|
|
3
|
+
[](https://github.com/SorobanAgents/agentrail/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@sparkysolutions/agentrail)
|
|
5
|
+
[](https://smithery.ai)
|
|
6
|
+
[](https://glama.ai/mcp/servers)
|
|
7
|
+
[](https://github.com/marketplace/actions/agentsentinel-ai-security-gate)
|
|
8
|
+
[](https://sorobanagents.github.io/agentrail/)
|
|
9
|
+
[](SCF_ACTIVATION_PROPOSAL.md)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://stellar.expert/explorer/testnet/contract/CBSWWN2CLUPW4VLYTGVJTT4XWXKF6LLJFQXEC7KK2KTAW3A26WIBZIN6)
|
|
12
|
+
[](tsconfig.json)
|
|
13
|
+
|
|
14
|
+
**Autonomous AI Agent Scoped-Allowance & Micro-Settlement Protocol on Stellar & Soroban.**
|
|
15
|
+
|
|
16
|
+
AgentRail is the missing autonomous economic layer for AI agents. It gives autonomous LLM agents and multi-agent meshes the ability to stream sub-cent payments, pay for inference and data APIs, and contract work via Soroban smart contracts โ **without exposing master private keys or requiring human popup clicks**.
|
|
17
|
+
|
|
18
|
+
> ๐ฎ **Try the Live Simulator:** [https://sorobanagents.github.io/agentrail/](https://sorobanagents.github.io/agentrail/) โ Connect Freighter, provision an allowance vault, and trigger autonomous micro-spends directly against Stellar Testnet.
|
|
19
|
+
> ๐ **Read the SCF Activation Proposal:** [`SCF_ACTIVATION_PROPOSAL.md`](SCF_ACTIVATION_PROPOSAL.md) โ 60-day roadmap for official Stellar Community Fund activation.
|
|
20
|
+
> ๐งญ **10-Minute Reviewer Guide:** [`docs/FOR-REVIEWERS.md`](docs/FOR-REVIEWERS.md) โ Fast zero-trust verification guide for Drips Wave & SDF reviewers.
|
|
21
|
+
> ๐ **Cryptographic Evidence & Mainnet Index:** [`EVIDENCE.md`](EVIDENCE.md) โ Live Public Mainnet Tx, IPFS CIDs, and Nirium Protocol reciprocal citations.
|
|
22
|
+
> ๐ **AgentRail 2.0 Manifesto:** [`docs/AGENTRAIL_2.0_MANIFESTO.md`](docs/AGENTRAIL_2.0_MANIFESTO.md) โ Protocol 30 Native, Post-Quantum Muxed Accounts & zk-Proof of Task.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ๐ Live Stellar Public Mainnet Settlement & Audit Attestation
|
|
27
|
+
|
|
28
|
+
AgentRail's autonomous agent spend settlement and receipt attestation are live on **Stellar Public Mainnet** (Protocol 30):
|
|
29
|
+
|
|
30
|
+
| Item | Network / Value | Independent Verification Link |
|
|
31
|
+
| :--- | :--- | :--- |
|
|
32
|
+
| **Agent Keypair** | Stellar Public Mainnet | [`GBHM5SCH2R5W5S63HVMQCXOFGCEXPSE2KL4GYRJY7GRTL4MYDB6M2CKY`](https://stellar.expert/explorer/public/account/GBHM5SCH2R5W5S63HVMQCXOFGCEXPSE2KL4GYRJY7GRTL4MYDB6M2CKY) |
|
|
33
|
+
| **Mainnet Settlement Tx** | Stellar Public Mainnet | [`1afd4afb9df3857466f70c09b8b5cabc514ac69c9aa1df316cf2168c5c72dcbb`](https://stellar.expert/explorer/public/tx/1afd4afb9df3857466f70c09b8b5cabc514ac69c9aa1df316cf2168c5c72dcbb) |
|
|
34
|
+
| **SEP-50 & Oracle Attestation Tx** | Stellar Public Mainnet | [`288f54bc6a2801c9357e0e21138420bdadedfcff76573c4e1c960c777c102f6a`](https://stellar.expert/explorer/public/tx/288f54bc6a2801c9357e0e21138420bdadedfcff76573c4e1c960c777c102f6a) |
|
|
35
|
+
| **ARBADGE Mainnet SAC Deployment** | Stellar Public Mainnet | [`38c160ebad0871362876930a04d11798891eb583780efee9bb791c9f4ddfd498`](https://stellar.expert/explorer/public/tx/38c160ebad0871362876930a04d11798891eb583780efee9bb791c9f4ddfd498) |
|
|
36
|
+
| **Mainnet SAC Contract ID** | Soroban Public Mainnet | [`CAQ3JEA3WWTQAOT7MSPHU2EYRKVOT4DIL2LIQCPOFRRJUP47YCZAPR2D`](https://stellar.expert/explorer/public/contract/CAQ3JEA3WWTQAOT7MSPHU2EYRKVOT4DIL2LIQCPOFRRJUP47YCZAPR2D) |
|
|
37
|
+
|
|
38
|
+
| **Protocol Version** | Mainnet | **Protocol 30 (Bell)** โ CAP-84 Muxed & CAP-87 Quantum resistant |
|
|
39
|
+
| **Reflector Oracle Guard** | Live Multi-Asset | Dynamic staleness & circuit-breaker protection (XLM/USD $0.52 validated) |
|
|
40
|
+
| **SEP-50 Agent Badge Memo** | Public Ledger | `sep50-agt-fcb13755fdd4f1c1` (DIAMOND Tier, 99/100 Reputation, Soulbound) |
|
|
41
|
+
| **XOXNO Showcase ID** | Verified Marketplace | `sep50-agt-fcb13755fdd4f1c1` (20 BPS Royalty to `GBHRSZLBJNR32ERCZT6PE3HJVVQGXT5KWQXGL5SVEPJXUQUDXSDBCWVE`) |
|
|
42
|
+
|
|
43
|
+
| **Receipt Content SHA-256** | Hex Digest | `2fd862b3b23d9d84d62fe139aa9d96f35b96b844a61f5f8e6e7ca6dd95a15238` |
|
|
44
|
+
| **Immutable IPFS CID** | Pinata Gateway | [`QmdJowsxyyDjv8UxwgceawgpZN4zsDUDaKeSiqDpQX3p8a`](https://gateway.pinata.cloud/ipfs/QmdJowsxyyDjv8UxwgceawgpZN4zsDUDaKeSiqDpQX3p8a) |
|
|
45
|
+
| **Nirium Independent Proof** | Open Verification | [`https://nirium.xyz/verify?cid=QmdJowsxyyDjv8UxwgceawgpZN4zsDUDaKeSiqDpQX3p8a`](https://nirium.xyz/verify?cid=QmdJowsxyyDjv8UxwgceawgpZN4zsDUDaKeSiqDpQX3p8a) |
|
|
46
|
+
| **Ecosystem Attestation** | Nirium Protocol | Cited in [`nirium-protocol/nirium` EVIDENCE.md](https://github.com/nirium-protocol/nirium/blob/main/EVIDENCE.md) lines 75โ76 & 99โ100 |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## ๐ช Live Soroban Testnet Deployment
|
|
51
|
+
|
|
52
|
+
The AgentRail Core Smart Contract with native protocol fee monetization is compiled, optimized (20.7 KB wasm), and live on **Stellar Testnet**:
|
|
53
|
+
|
|
54
|
+
| Parameter | On-Chain Verification |
|
|
55
|
+
| :--- | :--- |
|
|
56
|
+
| **Network** | Stellar Testnet (`Test SDF Network ; September 2015`) |
|
|
57
|
+
| **Contract ID** | [`CBSWWN2CLUPW4VLYTGVJTT4XWXKF6LLJFQXEC7KK2KTAW3A26WIBZIN6`](https://stellar.expert/explorer/testnet/contract/CBSWWN2CLUPW4VLYTGVJTT4XWXKF6LLJFQXEC7KK2KTAW3A26WIBZIN6) |
|
|
58
|
+
| **Treasury Address** | [`GDDJH64X5VEXI7UWZMJA3YUG7ANYHKRRRFHLD2SF5OWEETNFBVYMRXZT`](https://stellar.expert/explorer/testnet/account/GDDJH64X5VEXI7UWZMJA3YUG7ANYHKRRRFHLD2SF5OWEETNFBVYMRXZT) |
|
|
59
|
+
| **Protocol Monetization Fee** | `20 bps` (0.20% per micro-spend transaction) |
|
|
60
|
+
| **WASM Hash (SHA-256)** | `cc753a83d462acbca4c5b95f95ec0eb82c445f8ea72f30ea7ef53cb07b0869dd` |
|
|
61
|
+
| **WASM Upload Tx** | [`59d7c99d1cbb5be6d5e14ef00257a4b34813ab1e854c5adc208c1c243ecb891b`](https://stellar.expert/explorer/testnet/tx/59d7c99d1cbb5be6d5e14ef00257a4b34813ab1e854c5adc208c1c243ecb891b) |
|
|
62
|
+
| **Contract Creation Tx** | [`53d84cc06853897e6feba01c4ea88927ae0857483140b44e5d2c58fee2a1db11`](https://stellar.expert/explorer/testnet/tx/53d84cc06853897e6feba01c4ea88927ae0857483140b44e5d2c58fee2a1db11) |
|
|
63
|
+
| **Initialization Tx** | [`88855f18c6e25268bd98fd9d32ee68d82d0c82381b9e3aa82c824f5857d01951`](https://stellar.expert/explorer/testnet/tx/88855f18c6e25268bd98fd9d32ee68d82d0c82381b9e3aa82c824f5857d01951) |
|
|
64
|
+
| **Deployer Address** | `GDQZK73NVQCDJTTUMOOLF7IZ55IY4GS2TF6SNE7P7DVJ7XWICYAGJJA5` |
|
|
65
|
+
| **Soroban SDK Version** | `27.0.2` (Target: `wasm32v1-none`) |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## ๐ฐ Built-In Protocol Fee Monetization
|
|
70
|
+
|
|
71
|
+
AgentRail implements a sustainable on-chain protocol monetization engine:
|
|
72
|
+
- **Zero Friction Micro-Fee:** A standard fee of 20 basis points (0.20%) is calculated and routed automatically on every agent spend.
|
|
73
|
+
- **Treasury Payout Route:** Every micro-spend splits the payment on-chain: 99.80% settles to the service destination, while 0.20% routes directly to the designated protocol treasury wallet.
|
|
74
|
+
- **Configurable Governance:** Contract admin can adjust protocol fee parameters via `set_protocol_fee(treasury, fee_bps)` capped safely at 5.00% (500 bps).
|
|
75
|
+
- **Audit-Ready Events:** Dedicated Soroban topic events `("fee", "set")` and `("fee", "route")` provide real-time transaction transparency for on-chain indexing.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## โก The Problem: Why Traditional Crypto Wallets Fail for AI
|
|
80
|
+
|
|
81
|
+
1. **Master Key Vulnerability:** Giving an autonomous agent full custody of a root private key (`S...`) means a single prompt injection or hallucination can drain the entire treasury.
|
|
82
|
+
2. **Human Popups Break Autonomy:** Standard browser extensions (Freighter, MetaMask) require manual 2FA clicks, completely breaking 24/7 background AI agents.
|
|
83
|
+
3. **Gas Fees Kill Micropayments:** Ethereum ($2โ$10 gas) and Solana congestion make $0.0001 per-query inference payments economically impossible.
|
|
84
|
+
4. **Soroban State Archival (TTL Rent):** Soroban smart contracts and storage freeze if time-to-live (TTL) ledgers expire without active rent bumping.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## ๐ The Solution: How AgentRail Works
|
|
89
|
+
|
|
90
|
+
```mermaid
|
|
91
|
+
sequenceDiagram
|
|
92
|
+
autonumber
|
|
93
|
+
actor Human as Human Master / Treasury
|
|
94
|
+
participant Vault as AgentRail Soroban Vault
|
|
95
|
+
participant Agent as Autonomous AI Agent
|
|
96
|
+
participant Service as AI API / Data Provider
|
|
97
|
+
|
|
98
|
+
Human->>Vault: Provision Scoped Allowance (Max 10 USDC, 24h Epoch)
|
|
99
|
+
Vault-->>Agent: Grant Ephemeral Session Authorization
|
|
100
|
+
Agent->>Service: Query Data / Compute Task
|
|
101
|
+
Service-->>Agent: Return Output + Invoice (0.001 USDC)
|
|
102
|
+
Agent->>Vault: Spend Request (Signed by Session Key)
|
|
103
|
+
Vault->>Vault: Verify Epoch, Limit & Destination
|
|
104
|
+
Vault->>Service: Settle Instant Micro-Payment (3s Finality)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## ๐ Key Architecture & Capabilities
|
|
110
|
+
|
|
111
|
+
- **๐ Cryptographic Scoped Allowances:** Time-bounded, maximum-spend capped allowances stored in Soroban smart contracts with designated routing rules.
|
|
112
|
+
- **โก Sub-Cent Real-Time Streaming:** Sub-second payment calculations for pay-as-you-prompt inference fees in native Circle USDC on Stellar.
|
|
113
|
+
- **๐ก๏ธ Proof-of-Task Escrow:** Decentralized SHA-256 output verification ensuring funds are only released when verifiable outputs are delivered.
|
|
114
|
+
- **๐ Autonomous State TTL Keeper:** Continuous Soroban ledger monitoring and automated rent extension preventing state archival freeze.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## โฑ๏ธ 5-Minute Quickstart
|
|
119
|
+
|
|
120
|
+
Clone the repository and run the test suite locally:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
git clone https://github.com/SorobanAgents/agentrail.git
|
|
124
|
+
cd agentrail
|
|
125
|
+
npm install
|
|
126
|
+
npm test
|
|
127
|
+
npm run build
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## ๐ค MCP Server (Model Context Protocol)
|
|
133
|
+
|
|
134
|
+
AgentRail includes an official Model Context Protocol (MCP) server for **Claude Desktop**, **Cursor**, **Windsurf**, and autonomous multi-agent environments.
|
|
135
|
+
|
|
136
|
+
### ๐ฆ 1-Line Config for Claude Desktop & Cursor
|
|
137
|
+
Add this to your `claude_desktop_config.json` or Cursor MCP settings:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"mcpServers": {
|
|
142
|
+
"agentrail": {
|
|
143
|
+
"command": "npx",
|
|
144
|
+
"args": ["-y", "@sparkysolutions/agentrail"]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### ๐ ๏ธ Exposed Autonomous MCP Tools:
|
|
151
|
+
- `agentrail_spend`: Stream cryptographically authorized sub-cent spends.
|
|
152
|
+
- `agentrail_oracle_rate`: Live Stellar/Soroban Reflector oracle feeds and spread checks.
|
|
153
|
+
- `agentrail_x402_challenge`: Generate and verify HTTP 402 micro-payment headers.
|
|
154
|
+
- `agentrail_hustle_30min_audit`: Run 30-min balance growth diagnostic and trigger anti-stagnation directives.
|
|
155
|
+
- `agentrail_hustle_dispatch_fleet`: Deploy 24-agent autonomous earning fleet across 4 high-yield sectors.
|
|
156
|
+
- `agentrail_sep50_badge`: Verify or issue soulbound reputation badges.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## ๐ฆ SDK Usage Example
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import { AgentRailClient, usdcToStroops } from "@soroban-agents/agentrail";
|
|
164
|
+
|
|
165
|
+
const client = new AgentRailClient();
|
|
166
|
+
|
|
167
|
+
// 1. Provision a scoped allowance for an autonomous agent
|
|
168
|
+
client.registerAllowance({
|
|
169
|
+
id: "agent-session-001",
|
|
170
|
+
ownerPublicKey: "GOWNER...",
|
|
171
|
+
agentPublicKey: "GAGENT...",
|
|
172
|
+
maxStroops: usdcToStroops("10.00"), // 10 USDC ceiling
|
|
173
|
+
spentStroops: 0n,
|
|
174
|
+
validFrom: Math.floor(Date.now() / 1000),
|
|
175
|
+
validUntil: Math.floor(Date.now() / 1000) + 86400, // 24 hours
|
|
176
|
+
active: true,
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// 2. Autonomous agent authorizes a micro-payment for API inference
|
|
180
|
+
const result = client.spend({
|
|
181
|
+
allowanceId: "agent-session-001",
|
|
182
|
+
agentPublicKey: "GAGENT...",
|
|
183
|
+
destination: "GAPIPROVIDER...",
|
|
184
|
+
amountStroops: usdcToStroops("0.0025"), // $0.0025 per query
|
|
185
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
console.log("Spend Status:", result.code, "Remaining:", result.remainingStroops);
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## ๐งพ Optional Public Receipts
|
|
194
|
+
|
|
195
|
+
Opt-in and off the payment path. After a successful spend or a proof-of-task check, build a canonical receipt and anchor only its SHA-256 hash to a public Audit Trail node. You get back a CID that anyone can re-check at https://nirium.xyz/verify without an account. The receipt itself stays with you, and a proof-of-task receipt never includes the raw output or nonce. If anchoring fails, `anchorReceipt` returns `{ ok: false }` instead of throwing, so the spend is unaffected.
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { anchorReceipt, buildSpendReceipt, createAuditTrailProvider } from "@soroban-agents/agentrail";
|
|
199
|
+
|
|
200
|
+
const provider = createAuditTrailProvider(); // testnet node; pass { baseUrl: AUDIT_TRAIL_MAINNET_URL } for mainnet
|
|
201
|
+
|
|
202
|
+
if (result.ok) {
|
|
203
|
+
const receipt = buildSpendReceipt(request, result, { contractId: "CCONTRACT...", txHash }); // txHash is optional
|
|
204
|
+
const anchored = await anchorReceipt(receipt, provider, { tag: "agentrail-spend" });
|
|
205
|
+
if (anchored.ok) console.log("Receipt:", anchored.verifyUrl);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Proof-of-task: buildTaskProofReceipt({ taskId, agentWorkerPublicKey, taskCommitmentHash, verification, timestamp })
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### ๐ Live On-Chain Pipeline Spend Anchoring (Nirium Integration)
|
|
212
|
+
|
|
213
|
+
Beyond simulated sandbox runs, AgentRail features real on-chain pipeline spend settlement paired with cryptographically attested Nirium audit receipts (`npm run pipeline:settle`):
|
|
214
|
+
|
|
215
|
+
- **Real Stellar Payment:** Autonomous agent submits a real payment on Stellar Testnet with protocol fee routing (20 bps / 0.20% split directly to the protocol treasury).
|
|
216
|
+
- **Canonical Spend Receipt:** Generates canonical deterministic JSON with contract ID, allowance ID, agent public key, merchant destination, fee split, and transaction hash.
|
|
217
|
+
- **Ed25519 Agent Attestation:** The agent signs the audit commitment (`nirium-audit-v1:<sha256>`) using its own Ed25519 keypair.
|
|
218
|
+
- **Audit Trail Anchoring:** The cryptographic digest and agent signature are anchored to Nirium's live testnet audit node, producing a tamper-evident IPFS CID and open verification URL.
|
|
219
|
+
|
|
220
|
+
#### Verified Live Testnet Run
|
|
221
|
+
|
|
222
|
+
| Item | Proof & Value |
|
|
223
|
+
| :--- | :--- |
|
|
224
|
+
| **Transaction Hash** | [`14e72e04051d75430933d4245cb9dbfdd14e0c79bcaff0bd58a2f2839562385b`](https://stellar.expert/explorer/testnet/tx/14e72e04051d75430933d4245cb9dbfdd14e0c79bcaff0bd58a2f2839562385b) |
|
|
225
|
+
| **Gross Spend** | `1.0000000 XLM` (`10000000 stroops`) |
|
|
226
|
+
| **Protocol Fee (20 bps)** | `0.0020000 XLM` (`20000 stroops`) routed to Treasury [`GDDJH64X...`](https://stellar.expert/explorer/testnet/account/GDDJH64X5VEXI7UWZMJA3YUG7ANYHKRRRFHLD2SF5OWEETNFBVYMRXZT) |
|
|
227
|
+
| **Net to Merchant** | `0.9980000 XLM` (`9980000 stroops`) |
|
|
228
|
+
| **Agent Key** | `GBUQET3WRS4XLV6YYODLLFDQCZIODR3FDA3BUSHB4X6F36K6B6BAHPSQ` |
|
|
229
|
+
| **Receipt SHA-256** | `fc48ce2f221ea080377856ba8c07cb2c3fa469ab914ee394e349066c2b662fda` |
|
|
230
|
+
| **Agent Ed25519 Signature** | `ZX3bO2gbSQB3Gqa4q5YCD8bpifj7vlwlDnnnKUaB1w6C+6P2ak+dg8DULoUfIlyNwhiK4f6ucG3oFQOgCoU/CQ==` |
|
|
231
|
+
| **Tamper-Evident IPFS CID** | [`QmaYP7Lr2kRGLrdPHf1BYwLz7nSk9aC4xyU8s2ageGypm4`](https://gateway.pinata.cloud/ipfs/QmaYP7Lr2kRGLrdPHf1BYwLz7nSk9aC4xyU8s2ageGypm4) |
|
|
232
|
+
| **Nirium Independent Proof** | [`https://nirium.xyz/verify?cid=QmaYP7Lr2kRGLrdPHf1BYwLz7nSk9aC4xyU8s2ageGypm4`](https://nirium.xyz/verify?cid=QmaYP7Lr2kRGLrdPHf1BYwLz7nSk9aC4xyU8s2ageGypm4) |
|
|
233
|
+
| **Tag** | `agentrail-pipeline-spend` |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## ๐ Stellar Drips Wave Program
|
|
238
|
+
|
|
239
|
+
AgentRail participates in the **Stellar Drips Wave Program**.
|
|
240
|
+
|
|
241
|
+
- **Application Checklist & Bounty Queue:** See [`DRIPS_WAVE.md`](DRIPS_WAVE.md) for initial scoped tasks.
|
|
242
|
+
- **Contributor Guidelines:** See [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
243
|
+
- **On-Chain Claim:** Compliant [`FUNDING.json`](FUNDING.json) at repo root.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## ๐ License
|
|
248
|
+
|
|
249
|
+
Licensed under the [MIT License](LICENSE).
|