I was just reminded of the inscrutable sumerian "dogs walks into an inn" joke, while the meaning still eludes it gave me the question of how one was supposed to pay for a stay at an inn? From what I understand and given in previous answers the economies of settled agriculturalist societies like the Sumerians weren't purely barter, gift or distributionist but rather a complex and shifting mix.
I can understand how that would work for large transactions like wages where you literally get paid in bread or making deals for work in small communities like getting repairs done on farm equipment. However, how does that work if you are making a purchase of relatively small amounts but more than you would normally carry on yourself in say grain. There are also the issues associated being outside your normal community like a peasant travelling to the big city and staying at an inn? If trust is an important part of these pre-monetary societies how can the inn keeper trust in whatever the peasant promises? How does the peasant know what the inn keeper wants both in kind and quantity ahead of time (no advertising afaik)? They could be swimming in grain from customers or was it the case where everybody who sold services had to be mini grain merchants themselves, so they could then barter for goods they actually wanted?
Addressing the first half of your concern: Sumerian inns.
We almost certainly have a receipt of such a stay from the city of Nippur, the city of origin for that exact inscrutable proverb. It's about 3,750 years old.
"Since the first of the month of Arahsamnu (roughly mid-October), Warad-Ilabrat rented a bed belonging to Belshunu for 5.5 grains of silver."
A grain of silver was about .04 grams and places like town halls or temples would have had access to scales in order to measure such a small amount of metal. Unfortunately, we don't know much about either Warad-Ilabrat the guest or Belshunu the renter.
This text was found in a courtyard whose floor was covered with other artifacts that had been abandoned. It likely belonged to an adjoining house left to the elements. According to the excavators, "there was no violent destruction of the building. It seems merely to have gone out of use for a time."
That adjoining building was constructed and abandoned between 1756 and 1736 BCE, coinciding with the end of King Hammurabi's reign and the first decade of rule by his son, Samsu-iluna. This was a politically hot period in history, so (the lack of) destruction is an important aspect of study. The text can be accessed here. The excavator's notes are here.
Further exploration on the topic of credit & payment, and its broader context of trust for ancient economies:
Ancient economies had credit and debt systems (see David Graeber's Debt: The First 5,000 Years), as well as exchange and renumeration through institutions like temples, which we know about through wage lists, work rosters, and about 100,000 administrative documents dated between 2100-2000 BCE whilst under the Ur III state, a Sumerian-led government (see this thread and the answer by u/dub-sar-) But silver and grain was the standard currency.
Trust was built through individual relationships as you imagine, and also kinship and civic institutions, too. There are numerous cases where folks were victim to lawsuits due to missed credit payments. Just upstream from Nippur was the city of Sippar, where the earliest Old Babylonian letters (~1880 BCE) deal in part with a lawsuit against Ilumma, someone who had roughly a mina worth of debt to his name. Because he was a rather privileged trader, he seems to have had a kinship group settle the affair while he hid away in a nearby town.
Where folks didn’t have kinship groups, there is also legal tradition, exemplified by the Stele of Hammurabi or the Laws of Eshnunna, which date to this period of time, too. In these promulgations are costs of lawsuits and damages that ensure some level of social trust and accountability. In one promulgation by Shamshi-Adad, prices could be reportedly regulated:
“When I built the temple of the god Enlil, my lord, the prices in my city, Assur, (were): two kor of barley could be purchased for one shekel of silver; fifteen minas of wool for one shekel of silver; and two seahs of oil for one shekel of silver, according to the prices of my city, Assur.” (Link here).
Grain was stored personally, there are records of storage containers built into houses, and excess was also provided to merchants and traders who invested it elsewhere. There is reason to suspect that traders and merchants in particular were close with state institutions because of their access to large amounts of grain. That grain access often related to not just business ventures, but also storage, such as at the Grain Silos of Nanna at the city of Ur, just south of Nippur. While less evident, traders and merchants occasionally left ledgers and memoranda related to payments and dues that archaeologists have since discovered.
Sippar letters (click here).
Laws of Hammurabi and Eshnunna (click here).
Texts associated with Ur's grain silos (click here).
Edit remarks: I previously described silver and barley as fiat currency; while the price could be set by royal fiat, these goods were commodities and treated as such.