| title | E-RECEIPTING |
|---|---|
| author | GRIFFINS ODUOL <griffinesonyango@gmail.com> |
| status | |
| type | Standards Track |
| category | ERC |
| created | |
| requires | 721 |
Using Non-Fungible Tokens as a method of distributing digital receipts for physical purchases. Where the metadata represents an encrypted json receipt.
This EIP proposes a standard schema for digital receipts of transactions occuring on chain. Digital Receipt Non-Fungibles Token are issued by a vendor when a customer makes a purchase from their store and contains transaction details necessary for record keeping. The transaction details are encrypted against the customers public key and kept off chain. Digital Receipt Non-Fungible Tokens extend ERC-721 which allows for representing assets
If a customer purchases a physical item from an online retailer and uses a cryptocurrency to pay, the purchase will separately includes an invoice/receipt from the retailer that is emailed and/or physically given to the customer. These receipts are critical for many reasons but digital receipts have never gained traction. Instead we are left with PDFs and other analogue formats to represent transactions that occurred digitally.
Including an NFT as a receipt will provide a traceable and private link between the funds leaving the customers account and the digital receipt which may include important information such as serial numbers and delivery tracking etc. This means that the customer can automate their record keeping with systems and understand exactly what has been purchased without a human having to provide copies of the receipts. Metamask for example could show this full receipt when you click into an item in your transaction history.
One of the major roadblocks to fully automating our current finance world is that businesses need to keep detailed records of our purchases and retailer systems distribute this detailed information outside of our transactional system (Printing a physical receipt, while separately processing payment through the EFTPOS machine). Requiring a human being to physically make the link between the two, usually by data entry into the financial system. This is archaic and NFTs on the blockchain provide a method for this to be so much better.
Transaction Flow:
- A customer purchases an item from an online retailer, checking out leads the customer to payment through a smart contract.
- The smart contract verifys the amount transferred matches the order and provides the user with an Digital Receipt Non-Fungible Token.
- When fulfilling the order, the retailer will upload the digital receipt specified in (1) below, optionally using the encryption method specified in (2) which is encrypted against a derivative of the customers public key.
The elements of a Non-Fungible Token Digital Receipt as follows:
- Digital Receipt JSON Schema
- Optional Digital Receipt Encryption
The JSON schema is composed of 2 parts. One for the high level details in the receipt (for example Date and Vendor) and another for the line items contained in the receipt.
{
"id": "receipt.json#",
"description": "Receipt Schema for Digital Receipt Non-Fungible Tokens",
"type": "object",
"required": ["id", "date", "vendor", "items"],
"properties": {
"id": {
"title": "ID",
"description": "Unique Receipt ID",
"type": "string"
},
"date": {
"title": "Date",
"description": "Date of Receipt",
"type": "string",
"format": "date"
},
"vendor": {
"title": "Vendor",
"description": "Details of the entity issuing the receipt",
"type": "object",
"required": ["name", "address", "website", "contact"],
"properties": {
"name": {
"title": "Name",
"description": "Name of the issuer. E.g. Acme Corp",
"type": "string"
},
"logo": {
"title": "Logo",
"description": "URL of the issuer's logo",
"type": "string",
"format": "uri"
},
"address": {
"title": "Address",
"description": "List of strings comprising the address of the issuer",
"type": "array",
"items": { "type": "string" },
"minItems": 2,
"maxItems": 6
},
"website": {
"title": "Website",
"description": "URL of the issuer's website",
"type": "string",
"format": "uri"
},
"contact": {
"title": "Contact Details",
"description": "Details of the person to contact",
"type": "object",
"required": ["name", "tel", "email"],
"properties": {
"name": {
"title": "Name",
"description": "Name of the contact person",
"type": "string"
},
"position": {
"title": "Position",
"description": "Position / Role of the contact person",
"type": "string"
},
"tel": {
"title": "Telephone Number",
"description": "Telephone number of the contact person",
"type": "string"
},
"fax": {
"title": "Fax Number",
"description": "Fax number of the contact person",
"type": "string"
},
"email": {
"title": "Email",
"description": "Email of the contact person",
"type": "string",
"format": "email"
},
"address": {
"title": "Address",
"description": "List of strings comprising the address of the contact person",
"type": "array",
"items": { "type": "string" },
"minItems": 2,
"maxItems": 6
}
}
}
}
},
"items": {
"title": "Items",
"description": "Items included into the receipt",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "item.json#"
}
},
"comments": {
"title": "Comments",
"description": "Any messages/comments the issuer wishes to convey to the customer",
"type": "string"
}
"image": {
"title": "Image",
"description": "Viewable/Printable Image of the Digital Receipt",
"type": "string",
"format": "date"
},
}
}{
"type": "object",
"id": "item.json#",
"required": ["id", "title", "date", "amount", "tax", "quantity"],
"properties": {
"id": {
"title": "ID",
"description": "Unique identifier of the goods or service",
"type": "string"
},
"title": {
"title": "Title",
"description": "Title of the goods or service",
"type": "string"
},
"description": {
"title": "Description",
"description": "Description of the goods or service",
"type": "string"
},
"link": {
"title": "Link",
"description": "URL link to the web page for the product or sevice",
"type": "string",
"format": "uri"
},
"date": {
"title": "Supply Date",
"description": "The date the goods or service were provided",
"type": "string",
"format": "date"
},
"amount": {
"title": "Unit Price",
"description": "Unit Price per item (excluding tax)",
"type": "number"
},
"tax": {
"title": "Tax",
"description": "Amount of tax charged for unit",
"type": "number"
},
"quantity": {
"title": "Quantity",
"description": "Number of units",
"type": "integer"
}
}
}The encryption extension is OPTIONAL for digital receipt non fungible tokens. This allows your receipt to encrypted so only the intended recipients can view the data contained. This refers to the structure of the data pointed at by the NFT's url
The uuid provided in the receipt is a randomly-generated type 4 UUID as specified by RFC 4122. It is intended to be used as a 128-bit proxy for referring to a particular receipt, used to uniquely identify receipts.
This element MUST be present. It MUST be a string following the syntactic structure as laid out in section 3 of RFC 4122.
The version provided is the version of the receipt.
This element MUST be present. It MUST be the integer 1.
The type provided is the type of NFT. This informs consumers of the nature of the encrypted data
This element MUST be present. It MUST be the string receipt.
The crypto provided is the secure storage of a secret for users that require this information. For Digital Receipts Non-Fungible Tokens this is the json receipt itself.
This element MUST be present. It MUST be an object that follows the definition described in section 1 of this specification.
{
"$ref": "#/definitions/Receipt",
"definitions": {
"Receipt": {
"type": "object",
"properties": {
"crypto": {
"type": "object",
"properties": {
"kdf": {
"$ref": "#/definitions/Module"
},
"checksum": {
"$ref": "#/definitions/Module"
},
"cipher": {
"$ref": "#/definitions/Module"
}
}
},
"type": {
"type": "string"
},
"uuid": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "integer"
}
},
"required": [
"type",
"uuid",
"version"
"crypto"
],
"title": "Receipt"
},
"Module": {
"type": "object",
"properties": {
"function": {
"type": "string"
},
"params": {
"type": "object"
},
"message": {
"type": "string"
}
},
"required": [
"function",
"message",
"params"
]
}
}
}A standard for digital receipts, provides a link between purchases of physical items, the specific details of the transaction and the transaction on chain. This will allow for efficient analysis of transactions by finance systems and wallets leading to futher automation of the financial system.
This standard is an extension of ERC-721. It is not compatible with commonly used optional extensions (IERC721Metadata and IERC721Enumerable) mentioned in the EIP-721 standard.
The data stored in the crypto section of the receipt contains personally identifying information.