Algorand Transaction Note Field Conventions | Algorand Developer Portal

Algorand Transaction Note Field Conventions

Abstract

The goal of these conventions is to make it simpler for block explorers and indexers to parse the data in the note fields and filter transactions of certain dApps.

Specification

Note fields should be formatted as follows:

for dApps

<dapp-name>:<data-format><data>

for ARCs

arc<arc-number>:<data-format><data>

where:

WARNING: Any user can create transactions with arbitrary data and may impersonate other dApps. In particular, the fact that a note field start with <dapp-name> does not guarantee that it indeed comes from this dApp. The value <dapp-name> cannot be relied upon to ensure provenance and validity of the <data>.

WARNING: Any user can create transactions with arbitrary data, including ARC numbers, which may not correspond to the intended standard. An ARC number included in a note field does not ensure compliance with the corresponding standard. The value of the ARC number cannot be relied upon to ensure the provenance and validity of the .

Versioning

This document suggests the following convention for the names of dApp with multiple versions: mydapp/v1, mydapp/v2, … However, dApps are free to use any other convention and may include the version inside the <data> part instead of the <dapp-name> part.

Rationale

The goal of these conventions is to facilitate displaying notes by block explorers and filtering of transactions by notes. However, the note field cannot be trusted, as any user can create transactions with arbitrary note fields. An external mechanism needs to be used to ensure the validity and provenance of the data. For example:

{

"d": ... // actual data

"sig": ... // signature of the actual data (encoded using MsgPack)

}

In that case, the signature should be checked.

The conventions were designed to support multiple use cases of the notes. Some dApps may just record data on the blockchain without using any smart contracts. Such dApps typically would use JSON or MsgPack encoding.

On the other hands, dApps that need reading note fields from smart contracts most likely would require easier-to-parse formats of data, which would most likely consist in application-specific byte strings.

Since <dapp-name>: is a prefix of the note, transactions for a given dApp can easily be filtered by the indexer ().

The restrictions on dApp names were chosen to allow most usual names while avoiding any encoding or displaying issues. The maximum length (32) matches the maximum length of ASA on Algorand, while the minimum length (5) has been chosen to limit collisions.

Reference Implementation

This section is non-normative.

Consider ARC-20, that provides information about Smart ASA’s Application.

Here a potential note indicating that the Application ID is 123:

arc20:j{"application-id":123}

Consider a dApp named algoCityTemp that stores temperatures from cities on the blockchain.

Here are some potential notes indicating that Singapore’s temperature is 35 degree Celsius:

algoCityTemp:j{"city":"Singapore","temp":35}
algoCityTemp/v1:j{"city":"Singapore","temp":35}
algoCityTemp/v1/35:j{"city":"Singapore","temp":35}
algoCityTemp:j{"city":"Singapore","temp":35,"ver":1}
algoCityTemp:uSingapore|35
algoCityTemp:b#Singapore

(# is the ASCII character for 35.)

YWxnb0NpdHlUZW1wL3YxOoKkY2l0ealTaW5nYXBvcmWkdGVtcBg=

Security Considerations

Not Applicable

Copyright

Copyright and related rights waived via CCO.