This project implements a Milestone-based Escrow System on the Cardano blockchain using Aiken. It is designed to demonstrate the technical competencies required for a Cardano Catalyst Milestone Reviewer.
The core functionality ensures that funds allocated for a project are only released when specific milestones are achieved and verified by a designated reviewer.
-
Actors:
Funder: The entity providing the funds (e.g., Catalyst Treasury).Contractor: The entity doing the work (e.g., Proposal Team).Reviewer: The trusted entity verifying the milestone (e.g., Value Milestone Reviewer).
-
Logic:
- Funds are locked in the contract with a
Datumspecifying the milestone schedule. - Release: Requires a signature from the
Reviewer. Releasesamount_per_milestoneto theContractorand updates theDatumto increment thecurrent_milestone. - Cancel: Allows the
Funderto reclaim remaining funds, but requiresReviewerapproval (simulating dispute resolution or agreement).
- Funds are locked in the contract with a
This project serves as a proof-of-work for the following skills:
-
Understanding of E-UTxO Model:
- The contract verifies state transitions (Datum updates) to ensure legitimate progress through milestones.
- It handles UTxO consumption and creation (spending script input, creating continuing output).
-
Smart Contract Security:
- Implements checks for signatures, output values, and correct addresses.
- Prevents unauthorized access to funds.
-
Off-Chain Integration (MeshSDK v1.9.0):
- Includes TypeScript scripts (
offchain/src) to interact with the contract. - Demonstrates ability to use the latest MeshTxBuilder to construct complex Plutus V3 transactions.
- Implements robust wallet management and transaction signing.
- Includes TypeScript scripts (
validators/: Aiken smart contract code.offchain/: Node.js project for off-chain interaction using MeshSDK.plutus.json: Generated CIP-57 blueprint.
- Install Aiken:
aiken --version - Build Contract:
aiken build
- Run Tests:
aiken check
- Off-chain Interaction:
- Navigate to
offchain/ npm install- (Optional) Configure
.envwith a Blockfrost Key (seeoffchain/src/common.tsfor setup) - Run
npx ts-node src/release.tsto see the transaction builder in action (mock mode).
- Navigate to