Even in Hammurabi's code, receipts for agents, witnesses, and contracts, were only used for settling disputes in court where fraud may have been committed. Those instances with conflicting claims were a tiny minority of overall transaction volume, meaning receipts were optional and not required for the vast majority of transactions; especially between trusted parties.
As far as that "state" was concerned, all transactions were anonymous until a dispute was brought to court.
How long do you believe KYC has existed? How long do believe believe banks have existed?
When Mansa Musa decimated the global gold market for atleast a century by distributing large sums of money to millions of people on his Hajj (possibly the single largest event of anonymous value transfer in human history), what regulation or law did he violate?
As far as the vastness of human history is concerned, this was a very recent event.
Most of human history. People were born with this right.