epeer is an innovative decentralized energy trading platform built on top of the FireFly framework and the Cardano blockchain. The project aims to enable individuals, households, and microgrids to track, trade, and balance renewable energy in a secure, transparent, and tamper-proof environment.
epeer is a decentralized peer-to-peer energy tokenization and trading protocol built on the Cardano blockchain. It allows participants in an energy network to mint, lock, trade, and burn energy tokens (E-TOKENs) representing kWh of energy. The platform combines smart contracts, WebAssembly (WASM) components, and the FireFly multiparty system to enable transparent and programmable energy markets.
- Language: Rust
- Blockchain: Cardano (Conway Era, Plutus V3)
- Smart Contract Language: Aiken (Validator Scripts)
- Transaction Builder: Pallas (TxBuilder with StagingTransaction DSL)
- Off-Chain Workers: FireFly-compatible WASM modules (via Balius)
- UTxO Selection: Custom Rust functions for multiasset-aware selection
- System: Hyperledger FireFly
- Connector: FireFly Cardano Connector
- Multiparty Coordination: FireFly namespaces & broadcast/invoke flows
- Language: Python (PyQt5)
- Features: GUI Tabs for Mint, Burn, Sell, Buy
- Live Event Listener: WebSocket-based integration with FireFly events
- Producers: Mint energy tokens representing produced kWh
- Consumers: Buy and hold E-TOKENs for future redemption or trade
- Market: A shared contract address where E-TOKENs can be listed and purchased via smart contracts
- E-TOKEN: A multi-asset native Cardano token
- Minting: Done by authorized producers using Plutus V3 validators
- Datum: Inline datum includes price, quantity, and seller pubkey hash
- Mint / Burn Validator: Validates E-TOKEN issuance with proper redeemer format
- Sell / Buy Validator: Locks token at market script address with datum (quantity, price, seller)
All transaction flows are initiated via FireFly invoke requests and processed by WASM-based Balius workers:
- Selects ADA UTxOs
- Builds minting transaction with datum
- Adds collateral
- Submits signed transaction
- Selects token UTxO
- Constructs output to script address with datum
- Sets InlineDatum with quantity, price, seller
- Selects ADA UTxOs to match token price
- Reads and decodes InlineDatum
- Transfers token to buyer and ADA to seller
- Selects UTxO containing user token
- Consumes it via burn validator
- FireFly logging & event system used for feedback
- WebSocket listeners display contract events in PyQt GUI
- Pallas used for raw UTxO verification
- Errors traced via FireFly API and Cardano connector logs
- Integration with renewable energy meters via oracles
- Reputation system for producers
- Fractional token trading
- Aggregated market stats and charts in frontend
Maximilian Weber Germany
Developed as part of Juli of Code 2025 .
