Module M007
Advanced DApp Architecture
DirectEd x CATS Hackathon
Aiken Development Workshop Series
Duration: 3 hours
Format: 1.5 hours lecture + 1.5 hours exercises
Advanced DApp Architecture
DirectEd x CATS Hackathon
Aiken Development Workshop Series
Duration: 3 hours
Format: 1.5 hours lecture + 1.5 hours exercises
Welcome to the final module! Time to bring everything together and build production-ready DApps!
Understanding the plutus.json blueprint file
How validators communicate with transaction builders
Constructor indexing for off-chain code
Generating addresses and policy IDs
Multi-validator system design
Marketplace contracts with royalties
Staking & rewards mechanisms
DAO governance with voting
When you run aiken build, you get a plutus.json file.
This is the critical interface between on-chain and off-chain!
Aiken Code
(validators/*.ak)
plutus.json
(blueprint)
Off-Chain Code
(JavaScript/TS)
Most critical concept: Off-chain code uses numeric indexes, not constructor names!
The validator hash becomes a script address where funds can be locked.
For minting validators, the hash becomes the policy ID for tokens.
d5e6bf0500...hash...d4cc.MyNFT001
PolicyId (from hash) + AssetName = Unique Token
Real DApps use multiple validators working together!
Manages NFT listings with prices
Handles offers on listed NFTs
Enforces creator royalties
Validates NFT authenticity
Validators are connected through parameters. Understanding this flow is critical!
• Can't deploy out of order
• Each depends on previous
• Document clearly!
• Test deployment flow
Validators don't call each other - they communicate through transactions!
Validator B reads state from Validator A's UTxO (without spending it)
Validator requires specific token to be present in transaction
Validator A creates output with datum that Validator B processes
A marketplace allows users to list and sell NFTs with fees.
Users lock tokens to earn time-based rewards.
Token holders vote on proposals that govern the protocol.
Lock proposal with initial state (votes: 0, status: Active)
Token holders vote (voting power = tokens held)
After deadline: Check quorum & approval threshold
If passed: Execute proposal action (treasury, parameters, etc.)
Building production DApps requires optimization and planning.
Build production-ready systems! 🏗️
Read plutus.json, generate addresses, identify constructor indexes
Design escrow marketplace with parameter dependency tree
Implement NFT marketplace with List, Delist, Purchase
Build time-based staking with reward calculation
Implement proposal creation, voting, and finalization
List all validators first: blueprint.validators.forEach(v => console.log(v.title, v.hash))
Cross-reference blueprint definitions - use index, not constructor name
Parameter order must match exactly - check parameter types in blueprint
Ensure reference inputs are included, check redeemer indices match input order
You can now:
✅ Understand plutus.json blueprint structure
✅ Map on-chain types to off-chain representations
✅ Design multi-validator DApp architectures
✅ Build marketplace contracts with royalties
✅ Implement staking and rewards systems
✅ Create DAO governance with voting
✅ Deploy production-ready DApps on Cardano!
From Zero to DApp Developer
You've Completed the Workshop Series!
You can now build production-ready DApps on Cardano!
From smart contracts to complete systems 🏗️
Master of on-chain AND off-chain 💎
DirectEd x CATS Hackathon
GO BUILD THE FUTURE! 🚀