How to Build an Energy Market on a Blockchain