Milestone Proof-of-Work Escrow
Barter trades involving complex engineering, design, or infrastructure work cannot settle on simple handshake promises. Because counterparty risk rises with project size, NodeHash breaks multi-party barter cycles into discrete, inspectable deliverables governed by a deterministic milestone state machine. Rather than locking physical currency in custodial vaults, the protocol encumbers mutual credit headroom until deliverables pass cryptographic inspection.
Speculative cryptocurrency platforms lock volatile tokens into smart contracts where gas spikes and code exploits cause systemic failures. NodeHash takes a different route. The protocol locks mutual credit headroom directly on the participant's double-entry ledger account. This guarantees settlement capacity without exposing user balances to third-party custody or currency volatility.
The 6-Stage Milestone State Machine
Every milestone attached to an agreed trade follows a deterministic lifecycle. The state machine enforces step-by-step progression across six formal states:
Formal Milestone State Machine Architecture
Stepped execution progression from initial proposal through proof delivery, inspection, and credit release.
1. Proposed
Prerequisite: Formulated during trade negotiation.
The provider and beneficiary set deliverables, technical expectations, revision counts, and credit values.
The milestone remains passive until all participants sign the overarching exchange contract.
2. Funded
Prerequisite: Exchange transitions to active execution.
The ledger encumbers the agreed credit amount from the beneficiary's available balance or borrowing headroom.
Encumbered credits cannot be re-spent on other trades, protecting the provider from insolvency risks.
3. InProgress
Prerequisite: Previous milestone released or initial milestone active.
The provider executes development tasks, prepares verifiable assets, or performs scheduled pair sessions.
Real-time communication channels remain open for clarifying technical scope questions.
4. Submitted
Prerequisite: Deliverables meet specification criteria.
The provider calls POST /milestones/:milestoneId/submit with cryptographic proof artifacts.
Submitting proof triggers the beneficiary review clock and locks further proof modifications.
5a. Accepted / 5b. Disputed
Accepted: Beneficiary reviews artifacts within the inspection window and signs acceptance.
Disputed: If deliverables fail tests or breach terms, either peer flags a dispute with evidence.
Arbitration handles contested deliveries, choosing revision, release, or refund.
6. Released
Prerequisite: Milestone accepted by beneficiary or resolved by arbitration.
The ledger transfers encumbered credits to the provider's balance instantly.
When all stepped milestones reach this state, the full trade completes with final feedback ratings.
Complete State Transition Matrix
The escrow engine guards against out-of-order execution, unilateral fund confiscation, and unverified state advancement:
| Current State | Trigger Event | Guard Condition | Next State | Ledger & Platform Side Effect |
|---|---|---|---|---|
Proposed |
ExchangeAgreed |
Unanimous cryptographic signatures verified | Funded |
Encumber mutual credit capacity on beneficiary wallet. |
Funded |
ActivateMilestone |
Preceding milestone completed or index is zero | InProgress |
Open submission portal, start deliverable work clock. |
InProgress |
SubmitMilestoneProof |
Valid payload with commit SHA or verifiable asset URL | Submitted |
Record submission hash, start 72-hour review timer. |
Submitted |
ApproveMilestone |
Reviewer matches beneficiary public key | Accepted |
Mark milestone approved, ready for immediate clearing. |
Submitted |
DisputeMilestone |
Reason string provided within 72-hour window | Disputed |
Freeze milestone timer, notify dispute council. |
Submitted |
InspectionTimeout |
72 hours elapsed without beneficiary response | Accepted |
Auto-approve milestone to shield provider from abandonment. |
Disputed |
ResolveDispute (resubmit) |
Arbitrator permits scope correction | InProgress |
Clear dispute flag, unlock submission endpoint. |
Disputed |
ResolveDispute (refund) |
Breach confirmed, work non-deliverable | Released |
Return encumbered credits to beneficiary, record fault. |
Accepted |
SettleMilestone |
Ledger invariant satisfied (∑ ΔC = 0) | Released |
Credit provider balance, advance exchange stepper. |
Verifiable Proof-of-Work Delivery Artifacts
NodeHash rejects vague text affirmations like "done" or "finished". Every milestone submission requires tamper-evident digital artifacts that prove real work occurred. When calling POST /api/v1/exchanges/:exchangeId/milestones/:milestoneId/submit, providers include structured references matching the milestone deliverable schema:
| Artifact Category | Deliverable Type | Verification Mechanism | Required Payload Metadata |
|---|---|---|---|
| Software Engineering | Pull Request / Branch | Git Commit SHA & Tree Hash | Repository URL, commit hash, CI test status, PR link. |
| Systems & DevOps | Infrastructure Deploy | Endpoint Health & Logs | Base URL, health check endpoint, SHA-256 config checksum. |
| Digital Assets | Design / Documentation | Content-Addressed Storage | IPFS CID or cryptographic SHA-256 archive digest. |
| Live Consultation | Pairing / Advisory | Dual-Signed Time Receipts | Meeting duration receipt signed with peer passkeys. |
Milestone Submission Payload
Here is an example of an authenticated software engineering milestone submission payload:
{
"milestoneId": "ms_escrow_84920",
"exchangeId": "exc_cycle_3091",
"proof_payload": {
"summary": "Implement PostgreSQL query indexing and connection pool tuning",
"artifacts": [
{
"type": "git_commit",
"repo_url": "https://github.com/nodehash-cycles/core-trade",
"commit_sha": "d7b8e4f1a23c456890123456789abcdef0123456",
"pr_url": "https://github.com/nodehash-cycles/core-trade/pull/42",
"ci_build_url": "https://ci.nodehash.local/builds/98210",
"test_results": {
"passed": 84,
"failed": 0,
"latency_improvement_pct": 38.5
}
},
{
"type": "benchmark_report",
"digest": "sha256:4f82d17c91a0b3e584f29104c86b2451f28019ab3c91e47e620d8291fbc5e104",
"public_url": "https://storage.nodehash.local/reports/exc_3091_ms1.pdf"
}
],
"deliverable_notes": "All query times on trades table reduced below 45 milliseconds. Indexes verified with EXPLAIN ANALYZE."
}
}
Beneficiary Inspection Windows & Auto-Approval
Once proof is submitted, the beneficiary enters an active inspection window. Fairness requires balancing two opposing risks: preventing beneficiaries from accepting work without checking quality, and stopping unresponsive beneficiaries from withholding credit indefinitely.
72-Hour Inspection Window
The beneficiary has exactly 72 hours from proof submission to review deliverables against agreed criteria.
During this window, the beneficiary tests the code, checks build artifacts, or reviews documentation.
The beneficiary can approve the submission or raise a dispute if deliverables miss agreed requirements.
Auto-Acceptance Safety Guard
If the 72-hour review clock expires with no action, the node triggers automated acceptance.
Encumbered credits transfer to the provider automatically, preventing bad actors from ghosting completed work.
If the beneficiary needs extra inspection time, both parties can mutually sign a single 48-hour extension.
Inspection Lifecycle Flow
Provider NodeHash Ledger Beneficiary
| | |
|-- 1. Submit Proof -------->| |
| (commit SHA, test logs) |-- 2. Notify & Start Clock -->|
| | (72h Inspection Window) |
| | |
| |<-- 3a. Approve Deliverable --|
| | (Passkey Signature) |
|<-- 4a. Credit Released -----| |
| (Available Balance +C) | |
| | |
| | --- OR --- |
| | |
| |<-- 3b. Dispute Milestone ----|
| | (Discrepancy Details) |
|<-- 4b. Mediation Freeze ----|---------------------------->|
| (Arbitration Active) | |
Dispute Resolution Protocol & Arbitration Flow
Disagreements happen when deliverables fail unit tests, miss agreed functional criteria, or drift beyond negotiated boundaries. NodeHash resolves disputes through a predictable multi-stage protocol that balances fair remediation with network accountability:
- Formal Dispute Notice: Either peer calls
POST /api/v1/exchanges/:exchangeId/milestones/:milestoneId/disputewith specific discrepancy evidence. - Mutual Mediation Window: Parties receive 48 hours to communicate directly through the secure node channel. If the issue is a minor oversight, the provider can push a patch and resubmit revised proof without external involvement.
- Sponsor Lineage Escalation: If direct agreement fails, the dispute escalates to peer arbitrators chosen from uninvolved sponsor lineages with high trust scores.
- Binding Resolution: Arbitrators review the initial negotiation contract against submitted test artifacts and issue one of three verdicts:
- Resubmit (Remediation): Provider receives a 72-hour window to correct defects. Milestone resets to
InProgress. - Arbitrated Approval: Arbitrators determine deliverables meet the agreed specification. Milestone moves to
Acceptedand credits release to the provider. - Cancellation & Refund: Arbitrators find serious breach or non-delivery. Encumbered credits return to the beneficiary's headroom.
- Resubmit (Remediation): Provider receives a 72-hour window to correct defects. Milestone resets to
Unjustified defaults or malicious non-delivery affect more than a single milestone. When an arbitration panel confirms a bad-faith default, the offender's credit rating drops, their dynamic borrowing limit contracts, and liability damping penalizes their sponsor lineage. Building trustworthy trade relationships remains the bedrock of network security.
Final Exchange Settlement
When every milestone in a barter exchange reaches Released, the exchange advances to completion:
- Atomic Ledger Commit: Every peer's mutual credit debits and credits clear simultaneously, preserving the network invariant $\sum B_i = 0$.
- Cryptographic Completion Receipt: Each counterparty signs
POST /api/v1/exchanges/:exchangeId/completewith satisfaction feedback and ratings (1 to 5 stars). - Trust Lineage Score Recalculation: Successful completion boosts each participant's trade count, expands their credit headroom, and reinforces their sponsor's endorsement strength.
To see how mutual credit headroom dynamically expands following successful milestone releases, explore our credit risk governance guide next.