How to program a cryptocurrency