Skip to content

Latest commit

 

History

History
97 lines (77 loc) · 4.69 KB

CIP-0020.md

File metadata and controls

97 lines (77 loc) · 4.69 KB
CIP Title Authors Comments-URI Status Type Created License
20
Transaction message/comment metadata
Martin Lang <martin@martinlang.at>, Ola Ahlman <ola@ahlnet.nu>, Andrew Westberg <andrewwestberg@gmail.com>
no comments yet
Draft
Informational
2021-06-13
CC-BY-4.0

Abstract

This proposal describes a basic JSON schema to add messages/comments/memos as transaction metadata by using the metadatum label 674. Adding informational text, invoice-numbers or similar to a transaction on the cardano blockchain.

Motivation

We have the utilities on the cardano blockchain now since the introduction of the "allegra-era". A simple consens about adding messages, comments or memos to transactions is still missing. So the CIP authors came together to form a first implementation of this. It is straight and simple, additional keys and content can be added later. The IOG main wallet Daedalus can now also directly show attached metadata information in the transaction details view. This CIP is the missing link to bring it together.

Current Tools/Sites/Explorers that have implemented it already or have plans to implement it:

Specification

The specification for the individual strings follow the general design specification for JSON metadata, which is already implemented and in operation on the cardano blockchain. The used metadatum label is "674":, this number was choosen because it is the T9 encoding of the string "msg". The message content has the key "msg": and consists of an array of individual message-strings. The number of theses message-strings must be at least one for a single message, more for multiple messages/lines. Each of theses individual message-strings array entries must be at most 64 bytes when UTF-8 encoded.

Format:

{ 
  "674":
         { "msg": 
                  [ 
                    "message-string 1" //Optional: ,"message-string 2","message-string 3" ...
                  ]
         }
}

Example for a single message/comment/memo:

{ 
  "674":
         { "msg": 
                  [ 
                    "This is a comment for the transaction xyz, thank you very much!"
                  ]
         }
}

Example for multiple messages/comments/memos:

{ 
  "674":
         { "msg": 
                  [ 
                    "Invoice-No: 1234567890",
                    "Customer-No: 555-1234",
                    "P.S.: i will shop again at your store :-)"
                  ]
         }
}

Example above in Daedalus currently (could be improved if CIP is implemented): image

Cardanoscan.io, Adastat.net and other tools implemented it already, to show messages along transactions: image image

Rationale

This design is simple, so many tools on the cardano blockchain can implement it easily. The array type was choosen to have consistency, no need to switch between a string or an array format, or testing against a string or array format. Updates in the future are possible, like adding a versioning key "ver":, adding a key "utxo": to provide specific data for every tx-out#idx in the transaction, making subarrays in the message-strings, etc. But for now, we need a common agreement to provide general messages/comments/memos with this CIP.

Wallet Implementation

Would be a good idea to hide the message/comment/note behind a "show unmoderated content" button/drop-down. Like the Metadata display on the Cardano Explorer. Also, it should be displayed as plain-text non-clickable. To enhance security further, URLs could be automatically deleted or hidden from such comments, to not welcome bad actors with phishing attempts. Another solution to start with would be to really limit the character space for display in Wallets, like limiting it to a-zA-z0-9 and a handful of special chars like +-_#()[]: without a .<>"/\ chars, so a domain or html code would not work. Last points are worth for discussions of course, because it would also filter out unicode.

Copyright

This CIP is licensed under CC-BY-4.0