We use cookies to provide the best site experience
Okay

Introduction

Economist, scientific Director of the graduate FINTECH, Director of research Thalamus Lab, Ranepa
Chapter 1. Introduction and game theory
Alexander Didenko

Rai stones and cashless payments

Money
Barter and money are key inventions of mankind. From left to right are global currencies of mankind since ancient times: cattle — the oldest means of payment used today; Athenian tetradrachm, which was in circulation in all the trading cities of the Mediterranean; and huge Rai stones, with which Polynesians rendered basic financial operations. Difficulty of mining/producing and relative rarity determined their popularity as means of payment.
They say, that once upon a time Polynesians were transporting one of their huge Rai stone between two islands. Sudden storm sent the raft and all the cargo deep to the ocean. But entrepreneurial sailors knew where the stone was. They knew that nobody in the world possessed technology which would allow lifting the stone from the bottom of the ocean and putting it back into cash turnover. So, they decided to record the ownership of the stone. They say this is how cashless system was invented — even before Knigths Templars invented letter of credit.
I am not sure whether this is an anecdote, or a true story; but this is where my story begins, and from now on I know for sure, that this it is pure fiction, which I would use to illustrate several important concepts of distributed currencies. In my story islanders recorded their, so called, transactions like these:
  • «Teuila paid Arihi the Rai from the ocean deep for drove of pigs»
  • «Elei gave La'ei a boat full of fish for the Rai from the Ocean Deep»
  • «Fetuilelagi paid 0.0001 of the Rai from the ocean deep to Puleleiite for one brand new empty clay pot»
They made nicks on a large log which was dug in next to the island's main temple. Anyone could record a transaction, and Templar priests kept everything in order. When someone wanted to spend the Rai from the Ocean Deep, he first had to prove that he had it. To do this buyer and seller came to the log and buyer selected from amounts he previously received (they were called «inputs») the quantity he needed to pay (it was called «output», or «outputs», as one transaction could have several recipients). After spending some time to check, seller made sure that not a single «input» entry was going to be spent twice, it meant that the transaction was valid. If the sum of the inputs was slightly larger than the sum of the output, two recipients were recorded in the transaction. The seller received the amount of the Rai he needed, and the buyer wrote the «change» back on him. It looked like this:
  • «Elei took the Rai, got the boat full of fish from La'ei and sent 0.01 of the Rai to Puleleiite for brand new clay pot and gave the rest 0.99 back to Elei»
  • «Elei took 0.99 of the Rai, received the change from the transaction with Puleleiite and sent 0.5 to Teuila for a half of his drove of pigs and then sent back the change»

Clay tablets and «closing the block»

Sumerian «cheque» confirming the payment of tax to the ruler. After the table was baked on fire, one might physically destroy the tablet, but it was impossible to change the information recorded on it. Real Polynesians never used it, but the real Sumerians built a completely modern financial system with this technology (by the way, partially decentralized): in the Pushkin Museum in Moscow you can see real derivatives — forwards — for grain, made four thousand years ago.
The evil Attacker lived near the village. He was rich, but for some reason, which everyone forgot, nobody wanted to deal with him. His aim was to prevent the islanders from spending their money. Not everyone on the island was happy with the Rai innovation, so it was easy for the Attacker to find the Accomplice for his dirty deeds. One dark night the Accomplice sneaked quietly to the island's main temple and changed several fresh transactions making himself the recipient. Attacker and Accomplice even managed to spend several pieces of the Rai before cheating was detected. Thus, they got the half of the boat of fish for free leaving the islanders with no catch and money.
So, islanders approached tribal elders and asked for their advice. Tribal elders thought a little and advised to change the system by introducing clay tablets. Sellers and buyers continued recording transactions making nicks on the log (now the log was called «mempool»), and when mempool was full, the priests copied transactions to clay tablets (they were called «blocks») and then burnt them. After hardening, the information graved on the tablets could not be falsified without destroying the tablet, that would be immediately identified. Therefore priests called this operation «closing the block».
Closing the block took time and efforts, and priests started taking share for this operation. Now at least two recipients were recorded in each transaction: seller, who received the Rai for goods and services, and the temple, which received its commission for processing the transaction. Both sellers and priests now checked for double spending because no one wanted to receive the Rai spent twice as unlucky fishermen did in the first case.
Although anyone at any time could put transactions in the mempool, no invalid transaction could break through such a double filter of checks. An interesting side effect appeared: the one who was eager to process his transactions first could simply offer more commissions. Templar priests processed this transactions in the first order, as they wanted to get more money.
Spirits of ancestors, math magic and hash twins
Once the whole tribe went to war with a neighboring island. Meanwhile, the Attacker found another Accomplice because he was offended that he was not taken to war. Together they produced several clay blocks at the Attacker's hut recording a lot of fake transactions, and since all the priests were drafted into the army as war magicians, it was not a problem for the Accomplice to replace the tablets in the empty temple. The forgery was revealed when the army came back from the campaign and plentiful trophies were injected in island's market.
Priests called spirits of ancestors asking for an advice. Spirits said, «We know what to do. There is a twin-spirit in our world for any word, or name, or verse, or spell, or transaction, or string, which you, mortals, say in your world, for any version of it, even slightly altered. We call this twin-spirit "hash", and his name is always 64 letters in length. None of you, mortals, could guess by merely looking at hash it is twin string from your world. It is easy to go to afterworld, but it is impossible to come back! And now we will teach you how to summon hashes».
And they presented priests special math magic spell. Long time ago they taught priests how to use math for complex astronomical calculations to predict weather, winds and change of seasons, so priests were pretty good at math. One priest immediately tested the function on his favourite sacred text, The Hymn of Pele and Hi'iaka. He sang:
«We stood to sail with my kindred beloved
To an unknown land below the horizon;
We boarded — my kinsmen and I — our craft,
Our pilot well skilled, Ka-moho-alii.»
Then he applied math magic and summoned hash of this verse. The name of the hash was:
  • «8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918»
Then the other priest said that he sang it wrong and he had another version of this Hymn:
«We stood to sail with my kindred beloved
To unknown land below the horizon;
We boarded — my kinsmen and I — our craft,
Our pilot well skilled, Ka-moho-alii.»
Then the second priest applied math magic and summoned hash of this version of the verse. And, to his surprise, he revealed that hash-twin of this verse had completely different appearance:
  • «c4ab7c1655886a2f66bede451557b5b67d576e41d52e80895c6368e2a9704be0»
Nobody knew what this letters and numbers meant and nobody could by merely looking at this letters and numbers guess its twin from original world. Those who knew the hash-spell could summon hash-twin from the afterworld.
And then the third priest summoned hash for only one word, «Ka-moho-alii», the name of the craft's pilot from the Hymn, and got:
  • «1e69203553ada7cf4703c2d190dd660e060c746404992bdc5f28dbf6705a4386»
That was mystical hash-twin of Ka-moho-alii from the afterworld. It had grown to 64 letters there. Then they together sang the whole Hymn, in which there were as many verses as there were stars above the Ocean, and again they got mystical string with only 64 letters and numbers. Hash-twin of the whole Hymn magically convoluted to 64-letters hash. But the knowledge of hash-twin would not help to connect to words from the real world. It is easy to go to the afterworld, but it is impossible to find the way out, just as the ancestors spirits said.
Hermit and numbers that can be used only once
This hash magic could be used in two ways. First, it helped to authorise users in transactions. More and more islanders used the cashless Rai. They started to drown their cash to deposit it in the Great Ocean as the Rai. Thus, more and more Rais entered the system. Priests were afraid that they would not remember every user in person. Unique face of hash-twin now could be used as identifier for real people faces. Everyone needed to remember some key phrase, for example, his favourite verse from the Hymn. But if somebody forgot sacred verses of the Hymn, terrible punishment would await him. All unspent Rai inputs written to him, would go to the afterworld, and nothing could return them from oblivion.
And then hash-spirits served priests the other way too. Now for every transaction, which was naturally a string itself, priests summoned its hash-spirit and wrote its name after the text describing transaction to seal the deal. It was comparatively easy for a priest to check at any time whether the name of hash-spirit sealing the transaction really matched the transaction itself.
This system worked without failures for several years. But then the evil Attacker came back again. He found his way to the land of hash-spirits. Nobody knew how he did this. Some said that he bribed several younger priests and they revealed a hash-spell to him. Some said he summoned spirits of evil ancestors and they taught him the secret of hash-spell. And finally there were those who believed that the Attacker observed many hash-names on the log (which was open to anyone, of course), compared these names to transaction texts, and, thus, found his own way to the afterworld full of hash-spirits. He waited for the great war again (unfortunately, at those time wars were abundant), changed several clay tablets writing fake Rai inputs on his new Accomplice, and then rendered double spending attack. His Accomplice claimed fake inputs and exchanged it for real-world goods.
This time priests approached the Hermit, an old priest who lived in the remote corner of the island. They told him about their cashless Rai system and its vulnerabilities. Hermit meditated for a month and came back with innovation.
— «That is why you fail», he told priests, «dark side our hash-spirits serve too. Only on proper ones we need to rely!».
— «And how do we know which one is proper, master Hermit?», asked priests.
— «Zeroes at spirits names are the way. Start with many zeroes proper hash name»
— «But how do we make hash to start with zero?»
— «The greatest teacher, failure is. Numbers that can be used only once are the answer. Nonces, I would call them. Find a nonce and you will see the light»
— «Master, that might take a lot of time, it is impossible to know such hash in advance!»
— «Patience you must have, my young padawan; the best defence from darkness hard work is»
Priests understood the Hermit pretty well. Now priests prior to summoning the hash-spirit added some random number to transaction. If hash-name they calculated started with «many» zeroes (elders decided, that «many» equals five in their case, but they might change this constant at any time they need), then that was proper hash-spirit. Otherwise, priest had to drop it, change random number and summon hash again. Many spirits would be turned down before proper one was found. But the time needed to find a nonce, which fits exactly this transaction and makes its hash a proper one, would serve as defence from intrusion. It would take the Attacker plenty of mythical priest-hours prior to summoning proper hash-spirit, and the check could be easily rendered at any time.
Proof-of-work and the longest chain rule
Again many moons have passed and system worked fine. It began to enjoy such popularity that even merchants from neighboring islands wanted to join. Priests built temples on all the islands, maintained several versions of log, made several copies of each clay tablet, which then they exchanged by water. At first, everyone was happy, it seemed that this measure additionally strengthened the security of the system. But once, the Attacker arranged with his Accomplice to spend the same one Rai at the same time. The Accomplice on his island bought the drove of pigs on him, and the Attacker on the other island using the Accomplice's code phrase bought a boat full of fish on his name. It took a while for islands to exchange tablets and to reveal a double spend attack!
In general, such things began to happen more and more often. It was not easy to establish reliable water communication between the islands in the Ocean, the tablets sank and were delayed due to storms and hurricanes, and when a new set of blocks finally arrived on another island, it turned out that It was completely incompatible with the blocks closed on this island. There were so many double spendings and other inconsistencies. But worst of all, temples on various islands began to quarrel among themselves. The reason was commission. After all, the one whose clay block is ultimately correct would receive the entire commission! And someone was burning the tablet for nothing. They visited the Hermit again.
— «Great split I foresee», he told priests, «a defence from darkness patience is no more would save us the longest chain proof-of-work I call it»
Priests understood their Hermit well. From now on each clay block would be sealed with its own hash-spirit. Next block would begin from the name of this spirit. So, if Attacker would change something in the block, say, 42, he would need to summon hash-spirits to seal all clay tablets from 42 to current block, and then burn all this tablets by himself. The older information in chain, the safer it is. Moreover, there is the only version of time in the system! Number of block is one «tick» of this time. Whoever possesses the longest chain, possesses the oldest time «tick» representing the biggest amount of proper hash summoning work done.
If the craft arrives with the clay tablets chain longer than the chain for which hash is summoned now, for example, when priest on island A is summoning hash for block 42, and the craft from island B arrives with tablets 42, 43, 45, we have to drop our version of 42 immediately and start summoning 46 with newcomer 45 as a predecessor (block 46 would start from hash of block 45).
Merkle from continent brings nodal writings
Many years have passed. Cashless Rai spread across all islands and prospered. Priests now faced two problems: speed of transactions and place of storage for the tablets. The temples that kept the full version of all the tablets from the moment of the foundation were more and more rare. That brought possible vulnerabilities to the system: what if at the end only one island would have the only full version of all blocks from the beginning, and then something apocalyptic, for instance, tsunami, volcano eruption, earthquake, would happen on that island? On the other hand, the longest chain rule prevented islanders from double spending attack, but kept them waiting for several weeks before transaction would be confirmed and spread across all islands.
But once islanders met a Traveller from distant continental lands. He told islanders about nodal writings popular among priests in his country. All transactions could be ciphered as nodes-letters on a cord. Cords then can be joined together on more senior cord. These senior cords were linked to higher layer of cords making a tree. Cords could be sent by birds. Parrots were even more unreliable, but they could be released in bulk and someone would definitely fly. Traveller said that his name was Merkle and islanders called this invention Merkle tree.
Nodal writing is almost a real blockchain. To «fake» the knots at the beginning of the cord, you need to untie all the nodes below the cord. Moreover, here we have almost a Merkle tree, because all the cords cling to the main cord. If the first node of the new cord were derived from the nodes of the last cord in a pile — it would be a real analog blockchain!
With fast and reliable cashless payment system archipelago economy started to prosper. Cruel wars became a thing of the past. Ease of transactions made proper stimulus for islanders, and now they invested their human capital in productive entreprises increasing total welfare. All cash Rai stones were trusted to Great Ocean and islanders lived in true cashless society, where nobody could impact their ability to spend money. But... Was it really like that?
Priests and temples remained the only monetary authority. Physically system was decentralized, but governance remained strictly centralized. Priests closely kept the secrets of nodal writing and hash-spirits. But if an Attacker bribed them, the whole system would be in his power. In addition, the priests of other temples did not like the elevation of competitors. Fortunately, this time contradiction was solved without revolution and bloody civil war (remember, this is purely fictional story). Free people of islands decided that from now on anyone can process transactions, in their temple, in the chief's palace,in an ordinary hut, or even on a huge balsa craft sailing across the Great Ocean.
Kauri shells and decentralized emissions
With further development of the system islanders faced another problem. Constant increase of values production on archipelago caused increase in cash Rai stones carving sector. What was once ancient and respectable profession, provision of fellow islanders with means of payment, became the food for greed, source of instability and home of low business ethics. More and more Rai stones were carved and «trusted to Great Ocean». It was very hard to check whether the Rai stone was in reality carved and «trusted to Great Ocean», or it was just fraudulent claim.
On the other hand, Rai carvers rarely managed to forecast correctly future level of production and archipelago economy suffered sometimes from inflationary shocks. Islanders asked for advice of the Hermit again, and were again surprised with his murmuring.
— «We trust not much the Great Ocean», he said, «must trust more ourselves. Carved by unreliable people Rai. Unreliable bees bring unreliable emission. Trust Ocean more. Not selfish is shellfish. Emission let them do»
And again, islanders understood their Hermit well. They needed a system with decentralized independent bias-free emission. Biologic ecosystem of the Great Ocean could be such a system. They partly returned to cash. Now they used Kauri shells for small everyday transactions and Rai cashless system to buy durable goods and real estate as well as investments.
First global currency
We will leave them at this very point, when they enjoy advantages of decentralized systems, and think how to take the best from both worlds of Kauri and Rai systems.
First global currency
Of course, the story described above is pure fiction. Although Kauri shells actually served humanity, they have been used for thousands of years on almost the entire territory of the planet. On the right is the exchange of kauri for coins on a market in India, the 19th century; in the next photo, kauri strung on thin canes used by the natives of the Pacific islands. On the third photo, Kauri and coins as part of monisto, traditional Chuvash female decoration. Theoretically, it could happen that some of the shells from the first shot appeared on the second and the third!
Made on
Tilda