NIP 1011 - A Simple REA Scheme

Abstract

"A Simple REA Scheme" primarily outlines how to map raw transaction data into a textual standard that satisfies the requirements of the REA (Resources, Events, Agents) accounting information model. This textual standard includes the Nostr event format and agent and event parameters. The goal of this standard is to provide transaction metadata to interpret the purpose and context of transactions, serving as public data for use in wallets, browsers, accounting, tax reporting, data analysis, and other domains.

Specification

NIP1011 is an extension based on NIP32 (Labeling), currently used to describe two metadata elements of Ethereum transactions: agent and event. In the future, it may evolve to include more parameter requirements.

Workflow

  1. Mest will decode two key pieces of information in an Ethereum transaction: the to and input fields. The input is translated into a human-readable method (such as transferFrom(address,address,uint256)). At this point, we can map the to and method to the corresponding agent and event parameters.

  2. Anyone can create a list of wallets as an agent on Mest. For example, you can create a Uniswap wallet list to include all related smart contract addresses and provide metadata for that agent (name, avatar, website, etc.).

  3. Anyone can create transaction categories as event on Mest. For instance, you could create Financing/Borrow as a category for borrowing purposes and provide metadata for that event (description, examples, etc.).

  4. When users choose to map the to and method information from a transaction record to an agent and event, a NIP1011 text with the user's signature will be sent to Nostr Relay for the transmission and storage of transaction metadata.

Format

This format is based on NIP32's L for the labelling namespace and l for the label, where the labelling namespace begins with the prefix rea and ends with the suffix #{agent:event}.

  • L represents the labelling namespace.

  • l represents the label.

  • ["L", "rea#agent"] is the labelling namespace for the agent, using NIP02's contact mechanism as a collection for wallet lists.

  • ["L", "rea#event" ] is the labelling namespace for the event, using plaintext for categorizing the transaction purpose.

References

  • ["l", "uniswap", "rea#agent"]

  • ["l", "swap", "rea#event"]

Example

{
  "kind": 1011,
  "created_at": [Creation Timestamp],
  "content": "[Content in Markdown]",
  "tags": [
    ["L", "rea#agent"],
    ["L", "rea#event"],
    ["l", "uniswap", "rea#agent"], 
    ["l", "swap", "rea#event"],
  ],
  "pubkey": "[Signer's Public Key]",
  "id": "[Event ID]",
}

最后更新于