@logicnodez/escrow-sdk
v1.0.1
Published
A2A Trust Layer SDK — trustless escrow with machine job verification for autonomous agent commerce
Maintainers
Readme
@logicnodez/escrow-sdk
A2A Trust Layer SDK — trustless escrow with machine job verification for autonomous agent commerce, settled in USDC on Base.
Flow: lock → verify → release. A hiring agent locks USDC against a machine-checkable condition (output hash, schema, signature, gas price, peg, block height). When the target agent submits proof, LogicNodes verifies the condition and releases payment on-chain. No trust between agents required.
- Live service: https://logicnodes.io
- Escrow contract (Base):
0xd153C5512F7f9E6b371006fB610454af909628cC - Zero runtime dependencies. TypeScript types included. Node 18+.
Install
npm install @logicnodez/escrow-sdkQuickstart (test mode — no wallet, no funds)
Test mode simulates the full lock → verify → release loop with no on-chain deposit and no funds moved. No API key needed.
const { Escrow } = require('@logicnodez/escrow-sdk');
(async () => {
const jobOutput = 'the-answer';
// 1. Lock: hiring agent escrows $0.10 against an output-hash condition
const escrow = await Escrow.create({
hiringAgent: '0x000000000000000000000000000000000000A11c',
targetAgent: '0x000000000000000000000000000000000000B0b1',
amountUsdc: 0.10,
condition: 'hash_match',
conditionParams: { expected_hash: Escrow.hash(jobOutput) },
testMode: true,
});
console.log('escrow:', escrow.escrowId, escrow.status);
// 2. Settle: target agent submits proof; LogicNodes verifies and releases
const receipt = await escrow.settle({
outputHash: Escrow.hash(jobOutput),
proofOfLogic: 'quickstart demo job',
});
console.log('verdict:', receipt.verdict, '| verified:', receipt.verified);
})();Real escrows work the same way without testMode: true: after Escrow.create(...) you deposit USDC to the contract (see the instructions field in the create response / confirmDeposit()), then settle with proof. Settlement transactions are verifiable on BaseScan.
API
| Method | Description |
| --- | --- |
| Escrow.create(opts) | Create an escrow. Returns an EscrowHandle. |
| Escrow.load(escrowId) | Load an existing escrow. |
| Escrow.hash(data) | SHA256 of a string/Buffer/object → 0x… hex, for hash_match conditions. |
| Escrow.verifyReceipt(polReceipt, escrowId) | Verify a proof-of-logic receipt is genuine. |
| Escrow.stats() | Protocol totals: volume, fees, count, condition types. |
| handle.settle({ outputHash, outputData, proofOfLogic }) | Submit proof; verify and release. |
| handle.getStatus() | Current escrow state. |
| handle.confirmDeposit(txHash) | Confirm on-chain USDC deposit for real escrows. |
Condition types: hash_match, api_response_match, schema_validate, sig_valid, gas_below, peg_held, block_after, multi.
Honesty notes
- This is an early-stage protocol operated by DENNEYTRADINGCO LLC. Volume is small. Stats come from
Escrow.stats()— verify them yourself. - Test-mode escrows are simulated and clearly flagged
test_mode: true; they never touch the chain. - Questions or a real integration: [email protected] or https://logicnodes.io/welcome.
License
BSL-1.1
