1. Clone And Inspect
Clone the repository and understand the validator, off-chain TypeScript, React frontend, research, and automation directories before changing code.
Developer and User Documentation
Clone the repository, configure and run the React frontend, build and test the Aiken and off-chain packages, then follow the complete configure, lock, receipt, and redeem flow.
Overview
This documentation is for developers evaluating or extending Agora Expansion and for users who need the practical wallet and Blockfrost workflow. Commands and source paths below follow the public GitHub repository.
Clone the repository and understand the validator, off-chain TypeScript, React frontend, research, and automation directories before changing code.
Install each package, configure Blockfrost for the connected wallet network, build the contracts and TypeScript, and run the repository test commands.
Walk through configure, lock, receipt, and redeem using the illustrated interface states.
Developer Start
Agora Expansion is a multi-package repository. The on-chain validator and off-chain transaction code live separately from the browser interface, while the research directory records the design behind using native assets as governance voting power.
v1.0.26-alpha. The Pages deployment workflow uses Node.js 20.
git clone https://github.com/ADAOcommunity/AgoraExpansion.git
cd AgoraExpansion
# Inspect the main packages
git status
Get-ChildItem
# Open either package
cd agora-expansion
# or: cd agora-expansion-fe
agora-expansion/Aiken validators, off-chain transaction builders, generated Plutus data, and emulator tests.
Browse contract packageagora-expansion-fe/Create React App frontend for wallet connection, asset configuration, locking, receipts, and redemption.
Browse frontend packageResearchPhase/Research notes, logic explanations, and CDDL specifications behind the governance-token design.
Browse researchSetup
The frontend is a static React app. A wallet can connect before Blockfrost is configured, but asset lookup and the full transaction flow require a Blockfrost project key for the same network as the connected wallet.
git clone https://github.com/ADAOcommunity/AgoraExpansion.git
cd AgoraExpansion/agora-expansion-fe
npm install
Copy-Item .env.example .env
# Preprod testing example
REACT_APP_BLOCKFROST_TESTNET_URL=https://cardano-preprod.blockfrost.io/api/v0
REACT_APP_BLOCKFROST_TESTNET_API_KEY=preprod_project_id_here
# Mainnet uses separate production values
REACT_APP_BLOCKFROST_MAINNET_URL=https://cardano-mainnet.blockfrost.io/api/v0
REACT_APP_BLOCKFROST_MAINNET_API_KEY=mainnet_project_id_here
npm start
Contracts And Tests
The contract package combines an Aiken multi-validator with TypeScript transaction
helpers. Build the TypeScript before running npm test because the test
script executes the compiled dist/src/test.js file.
cd agora-expansion
npm install
npm run build
npm run test
# Validator checks used by repository CI
aiken fmt --check
aiken check -D
aiken build
agora-expansion/. A successful run verifies the
TypeScript build, emulator flow, Aiken formatting, checks, and validator build.
src/test.ts.
validators/governance-token.ak contains the parameterized locker and minter handlers.
src/index.ts exports validator helpers, voting-power calculation, lock, and retrieve functions.
src/test.ts contains the package test entry point invoked after TypeScript compilation.
Source Map
Start at the ownership boundary closest to the behavior you need. The validator enforces on-chain rules, services prepare chain access and transactions, and React components own the browser workflow.
lib/agora/types.akContract configuration, datum, redeemer, and voting-power data types.
Open filelib/agora/utils.akToken naming, inline datum access, and voting-power calculation helpers.
Open filesrc/App.tsxTop-level frontend state and transitions between connection, configuration, lock, and redeem screens.
Open filecomponents/WalletConnect.tsxCIP-30 wallet discovery, permission, address selection, and network identification.
Open filecomponents/TokenConfig.tsxFT/NFT rule selection, asset search, weighting mode, and voting-power configuration.
Open fileservices/lucidService.tsBlockfrost initialization, network selection, address conversion, and wallet asset queries.
Open fileservices/lockTokensService.tsFrontend transaction assembly for voting power, locker addresses, locking, and retrieval.
Open filecomponents/TokenSelection.tsxEligible asset loading and the user path that selects and locks configured tokens.
Open filecomponents/NFTSelection.tsxReceipt NFT discovery and redemption workflow for recovering locked assets.
Open fileBuild And Deploy
The frontend uses Create React App with a relative homepage setting. The
production command writes static files to agora-expansion-fe/build/ for
GitHub Pages or another static host.
cd agora-expansion-fe
npm install
Copy-Item .env.example .env
# Add the required Blockfrost project IDs to .env
npm run build
# Static output
Get-ChildItem build
REACT_APP_* values are embedded when the build starts. Set deployment
values before building; a deployed static site cannot read your later local
.env changes.
.github/workflows/tests.yml installs the contract package, builds
TypeScript, runs the emulator test, and executes Aiken format, check, and build commands.
.github/workflows/deploy.yml installs the frontend with Node.js 20,
builds it, uploads build/, and deploys the artifact to GitHub Pages.
Concepts
These are the terms that matter for this tutorial. The definitions are scoped to how Agora Expansion uses them, so you can understand the interface without reading the full protocol specifications first.
CIP-30 is the browser wallet standard used by Cardano dApps. It lets the page request wallet access, read wallet state after consent, and ask the wallet to sign or submit transactions.
CIP-0030 referenceBlockfrost is the API layer the frontend uses to look up chain data. Each project ID belongs to a specific network, so a Preprod key will not work for a Mainnet wallet.
Blockfrost setup
Preprod is the safer testing network. Mainnet is production. Cardano address prefixes
make the difference visible: test addresses begin with addr_test, while
Mainnet addresses begin with addr1.
Cardano native assets are identified by the pair of policy ID and asset name. Agora Expansion uses this to decide which FTs or NFTs count toward configured voting power.
Native tokensWallet assets live in transaction outputs. A single output can contain ada plus native tokens, so the app reads wallet UTxOs before it can list eligible assets for locking.
Token bundlesIn this flow, the receipt NFT is the user's handle for redemption. The generate path locks selected assets and mints voting power plus a receipt; the redeem path spends the receipt to recover the locked assets.
Agora UI tutorialTroubleshooting
Most setup issues come from three separate systems being out of sync: the browser wallet, the Blockfrost project, and the configured Cardano asset identifiers. Use this guide before assuming the interface is broken.
REACT_APP_BLOCKFROST_*_URL and REACT_APP_BLOCKFROST_*_API_KEY values.cardano-preprod.blockfrost.io and a Mainnet project ID with cardano-mainnet.blockfrost.io..env values.Tutorial
Start with the setup checklist, then follow these illustrated steps. Select any screenshot to inspect the interface state in detail, or open the separate video walkthrough for the complete animated flow.
Open the GUI and choose a supported CIP-30 wallet. The wallet extension asks the user for permission before the app can read wallet state.
Choose the weighting mode, define the FT/NFT policy information, and set the voting-power values that the community will use. The policy ID and asset name are how the app recognizes eligible native assets.
After configuration, choose whether to generate voting power by locking assets or redeem a receipt NFT to retrieve previously locked assets.
Select eligible wallet assets. The live app builds a transaction from wallet UTxOs, then asks the connected wallet to sign and submit it.
Return to the action chooser and select Redeem Governance Tokens. This opens the wallet's list of receipt NFTs from earlier lock transactions.
Choose the receipt that represents the assets you want to recover. The Redeem Selected NFT button becomes available only after a receipt is selected.
Submit the selected receipt to recover the locked assets. For a live transaction, the wallet requests a signature and the submitted hash should be confirmed in a Cardano explorer.
Screenshot Reference
Browse each interface state at your own pace, from wallet connection and voting-power configuration through locking, receipt confirmation, and redemption.