Skip to content

Commit

Permalink
Transaction messages/comments metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmachtl committed Jun 14, 2021
1 parent 7913cf5 commit 483659d
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions CIP-0020/CIP-0020.md
@@ -0,0 +1,87 @@
---
CIP: 20
Title: Transaction message/comment metadata
Authors: Martin Lang <martin@martinlang.at>, Ola Ahlman <ola@ahlnet.nu>, Andrew Westberg <andrewwestberg@gmail.com>
Comments-URI: no comments yet
Status: Draft
Type: Informational
Created: 2021-06-13
License: 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:
* [CNTools](https://cardano-community.github.io/guild-operators/#/Scripts/cntools)
* [JorManager](https://bitbucket.org/muamw10/jormanager/)
* [StakePoolOperator Scripts](https://github.com/gitmachtl/scripts)
* [Cardanoscan.io](https://cardanoscan.io)
* [AdaStat.net](https://adastat.net)

# 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:
``` json
{
"674":
{ "msg":
[
"This is a comment for the transaction xyz, thank you very much!"
]
}
}
```

Example for multiple messages/comments/memos:
``` json
{
"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](https://user-images.githubusercontent.com/47434720/121822100-85b38a80-cc9d-11eb-9d13-1869746a69b2.png)


# 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.

# Copyright

This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode)

0 comments on commit 483659d

Please sign in to comment.