Debt describes our best, most evidence-supported historical understanding of the origin of money in the needs of the empires of the Axial Age (800 BCE to 600 CE). As imperial armies went a-conquering, they needed some way to provision the soldiers garrisoned in their far-flung territories. The solution was elegant – and terrible. Soldiers were paid in coin, minted and controlled by the state, which punished counterfeiters with the most terrible torments. Conquered farmers were taxed in coin, on penalty of violence and expropriation. Thus: the soldiers had coin and the farmers needed it. This meant that farmers would be willing to trade their produce for coin, which meant that soldiers would be provisioned. Tax-bills were nondiscretionary liabilities: failure to pay your tax would lead to violence and ruin. The value of money, then, came from taxation – from the fact that farmers needed coins. This need rippled out through society: Even if you didn’t farm, you would accept coins in exchange for your own labor and goods, because the farmers would accept coins in exchange for food (which everyone needs), because farmers needed coin to settle their tax-debts. Coins became money because there was a nondiscretionary, terrible obligation that you could only fulfill with coins.
Doctorow summarizes the origin of money as imperial debt
Cory Doctorow is summarizing the research of David Graeber's Debt: The First 5,000 Years. A government needed to pay its soldiers, so they were paid in coins. Conquered farmers needed to pay taxes in coins, so they would exchange with the soldiers for food. Others in the village saw that coins were valuable (in exchange for food), so they exchanged their labor for coins too.
There is also a story about the British Empire imposing a "hut tax" in Africa.