EDIT: Simplified the algorithm.
This thread is about examining the possibility of developing a cryptocurrency as a SAFE app. The idea is to have a decentralized coin called decoin managed by a single app.
Decoins are mined by hashing a code of a fixed length of 8 bytes. A Rule 30 hash function is used to produce 256 bit hashes. EDIT: The difficulty is set to 2 leading zero bytes. Each coin has the value 1 decoin (D1). [spoiler] The minimum difficulty is set to a number of leading zero bytes of the 32 byte hash, for example 2 leading zero bytes:
Difficulty level 1: 00nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Each higher difficulty level has an extra leading zero byte:
Difficulty level 2: 000nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Difficulty level 3: 0000nnnnnnnnnnnnnnnnnnnnnnnnnnnn
And so on up to difficulty level 6.
The value of each hash depends on the difficulty level as follows:
Level 1: 1 decoin.
Level 2: 10 decoins.
Level 3: 100 decoins.
Level 4: 1,000 decoins.
Level 5: 10,000 decoins.
Level 6: 100,000 decoins.
Mining level 1 coins is easy and can be done with a standard desktop or laptop computer. The higher levels get exponentially more difficult to mine. However in lucky cases higher level coins can be mined with very little computing power.[/spoiler]
The coins are stored on the SAFE network as Structured Data containing the code and signed by the issuer.
When the miner (app) finds a code that produces a hash satisfying the difficulty a check is done to see if that coin already has been mined and registered. If not, then the mining app signs and stores the coin on the SAFE network.
Transactions are done by transferring the ownership of the Structured Data from the sender to the receiver.
Double spending is prevented by having the data for each coin stored with its unique code.