In an isolated community there are two households with solar panel arrays: of Angel and of Bennie, they are producers of electrical energy. There's a consumer of electricity, a household of Carlos. All three of them are connected into an isolated electrical grid. When Carlos burns electricity, his meter turns and counts kWh consumed. Some of this power came from Angel and some from Bennie; neither of them want to give out free energy and would like to be compensated. How does Carlos know how much to compensate each? Does he divide equally? But Bennie may be farther away and most of the electricity has flown from Angel; does he calculate the distance to his neighbors? But there could be hundreds of producers in the community and they may not know or trust each other.
Smart meters as nodes on a blockchain
We don't need to derive every producer's contribution as long as we count the amount of energy outflow by smart meters at the producers' connection to the grid; while every consumer's meter measures energy consumed. Neither of the parties should know or trust each other. Each resident of the grid has an account on the blockchain with an amount of abstract electricity units: coins k. The balance of the account is changed by a smart contract according to the amount of energy consumed or produced. Every hour an embedded code in the meters sends the readings to a smart contract on a blockchain to settle their accounts. Consumers' accounts are debited and producers' credited. Some of the coins are set aside into the utility's account to pay for the maintenance of the grid. The contract does not move coins from consumers' accounts to the producers' directly as it is much simpler to first move the compensation from each consumer's account into a common account then move coins from it into each producer's account proportionate to their energy contribution.
The grid connecting producers and consumers needs to be maintained so some of the coins Carlos contributes are set aside into the utility's account for operational expenses. It could be a membership fee or a percentage of use. For simplicity let's use a small hourly fee of 0.01 k.
In order to be able to receive electricity a consumer needs to first fill in his account with coins. An hourly settlement moves coins from his account into the common pool. Once the coins in the consumer's account are depleted the meter disconnects the consumer from the grid. Once the account is replenished the smart contract notifies the meter to reconnect the consumer. Thus the hourly communication between the meters and the contract is two way: the meter reports the usage and gets back a decision to keep the connection open or not.
Funding arbitrary consumers
In the above examples a single resident pays for his own household: Carlos has his house's meter and pays for his own usage. But with the decentralized utility it does not have to be the only use case. A homeowners association may pool money to light their street; a condominium may pay for usage in their building hallways; a baseball team may pay to light a stadium at night. Each consumer of electricity: a household with a smart house meter or a lighting pole with its own meter may be funded with electricity coins from anybody's account. A municipality does not have to get involved. If a resident wants a lighting pole to illuminate his driveway he finds the lighting pole's id displayed encoded in a QR code and funds it with the coins from his account. This introduces transparency and promotes responsible spending of electricity.