Energy Use Case Smart Contracts of Lition Trading Platform
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts change license Jan 16, 2019

Lition Energy Use Case Smart Contracts

Creative Commons License

Follow on Twitter


Lition is developing the only scalable public-private blockchain with deletable data features, made for commercial products. Designed with Lition's live P2P trading use case, and co-innovated with SAP.

This repository shows the solidity smart contracts for the energy use case, which is the world's first peer to peer energy trading plattform commercially available to a mass market. You can test it at with the credentials demo / demo1234.

Development Environment

You need a recent version of nodejs and truffle (npm install -g truffle) because code is a very simple truffle project (pls check for details).

Documentation of the Contract EnergyStore

The smart contract EnergyStore is designed to record offers from power plants (producers) and choices from users (consumers). Each producer has its own Ethereum address; users interact with the contract using the owner's (Lition's) address by delegating their interaction to Lition.

The ethereum address that creates the contract is its owner. It is envisioned that this address is securely held by Lition.

Power plants (or conglomerates of power plants) are termed producers. It is envisioned that each producer securely holds one own address and shares this address (a hash of the public key) with Lition. Lition then calls a function of this contract to register the producer, allowing it to call another function to record offers of energy.


  • event BidMade(address indexed producer, uint32 indexed day, uint32 indexed price, uint64 energy) indicates that a new energy offer (bid) has been recorded.

  • event BidRevoked(address indexed producer, uint32 indexed day, uint32 indexed price, uint64 energy) indicates that a previously recorded energy offer (bid) is no longer valid.

These events use (essentially) the same parameters (producer instead of aproducer, price instead of aprice) as the setter functions.

EnergyOffered is emitted whenever a producer records a new energy offer. EnergyOfferRevoked is emitted beforehand if (and only if) such an offer is cancelling a previous offer.

Unfinished Features

The various functions should emit events to simplify monitoring.

The registration function should allow setting a producer's capacity and the contract should not accept offers exceeding a producer's capacity.

The current time resolution for offers and choices is days; 1/4 hour may be needed in the future.


This repository is ethereum based smart contract POC for lition energy infrastructure.

Implementation is not always optimal as the main aim of this code is proof of decisions, problem highlighting. It will be replaced with highly efficient and enterprise ready blockchain solution developed by lition (see for more details).


Copyright 2018-2019 by Lition Technology AG,

Special thanks to core contributor Björn Stein from Quantum-Factory GmbH,

Free to use for non-commercial use under the following license: Attribution-NonCommercial-NoDerivatives 4.0 International