Introducing Digital Receipts and ERC5570

4 min read Original article ↗

Sean Darcy

Recently i opened a PR on the ethereum EIPS github repo, this opened ERC5570 which is all about digital receipts and how we can use them through the blockchain using NFTs.

Before I dive into the details of ERC5570 I want to explain the pain point of receipts in our current financial system. In the finance world businesses use their funds and stakeholders want to view a high level summary of how that business has used those funds, so accountants process the transaction data by classifying every transaction into a category. One of the core duties of an accountant is this classification of transaction data to transform it into a set of financials statements. This task of classifying a transaction is a relatively easy task for someone who actually spent the money, you know exactly what you spent that $50 on so you can easily and confidently classify that $50 as “purchase of inventory”. However if you outsource this task to a third party who did not actually spend the fund they need additional information because they don’g have the same context that you have. Historically this additional information came from things like cheque butts and in modern times the information we have available is a bank statement with a small amount data through a transaction reference.

Sometimes this small reference is enough for the third party to guess the context. If the bank statement says “inventorysupply pty” they there is a good chance its inventory. But this is not always the case, so usually the third parties request the business also send through their receipts.

Sometimes these receipts are physical paper that get stored on a spike and handed personally to the third party. Sometimes they are a pdf attached to an email that is forwarded to the third parties inbox until they process the transaction data. In both cases this is where the pain and errors occur, receipts get forgotten, the incorrect receipt is sent, emails get lost, and overall everyone has a bad time.

The dream solution is for the transaction to link directly to this receipt. Having all the context of every transaction available at the transaction source makes job of classifying the transaction incredibly easy. In fact it completely removes the uncertainty, which means a human is no longer needed for their professional judgement and the task can be completely automated by simple scripts.

This is something that banks/credit cards/retailers could have built a long time ago. However politics and other non technical factors have prevented us from achieving this utopia where no accountants exist.

Fortunately we here in the cryptocurrency space have a pathway, by using one of our favourite tools ERC721 — Non Fungible Tokens.

At its heart NFTs are an application that controls a list of identification numbers and a method of linking those IDs to a “tokenURI” which is usually just a regular http URL. The contents of that URL can be anything, however the metadata extension (optional but usually done) specifies three fields that should be contained for consistency. The fields are “name”, “description” and “image”. This plays well with our artwork nfts but it also can be extended with another field “receipt” which allows for us to populate it with all the details that a third party processing a financial transaction would ever need.

So the fields I’m proposing for digital receipts become:

  1. Name: Must be NFTDR to identify that this NFT is a digital receipt. It will also allow flexibility in future for versioning if we need to adjust the format in a ever changing world.
  2. Description: Arbitrary human readable context for the reader, i have been putting “digital receipt from your favourite accountant”.
  3. Image: A human readable image of the receipt! Something that can be printed and made to look nice for our visual senses.
  4. Receipt: The main data itself. Contains the expected things like date, amount, product name etc
  5. Signature: This is so the vendor can sign the receipt field above. Allowing you to physically tie the digital receipt to a legitimate vendor. Will dive into specifics at a later time but if we require the https website in the receipt and the vendor signs with their ssl certificate then we can leverage the chain of trust that already exists with web browsers to verify the validity of this receipt.

And with that we can see that our NFT structure is the perfect place for a digital receipt to live!

With this it will be possible to click on atransaction in your wallet to see that you spent $2 on milk and $3 on bread. You won’t ever have to forward the receipt to a third party because its already saved in the right place, nothing gets lost and everyone is happy.

Except the accountants, who no longer have a job.