Asset Registry Transaction Message (ARTM)

Overview

Asset Registry Transaction Message (ARTM) describes the standard approach for parsing updates to the off-chain Asset Registry database. One ARTM can describe multiple sequential operations on the Asset Registry. A ZK-rollup of these transactions will be pushed to The Root Network to validate the updates made to the Asset Registry periodically.

Motivation

When updating the Asset Registry, a clearly defined transaction message standard must be followed and used to prove updates reliably. This RFC takes inspiration from ERC-4361: Sign-In with Ethereum.

Specification

Asset Registry Transaction Message generation works as follows:

  1. A list of asset registry updates is first defined

  2. A message is created that starts with \\x19Ethereum Signed Message:\\n<length of message> as defined in ERC-191

  3. Each asset registry update will then be defined sequentially in the order the updates should take place.

  4. The end of the message will have the address making the updates and the nonce.

  5. The message will then be signed by the correct wallet

Operations

A list of operations can be found on theTransaction Operations page.

Transaction Hash

A transaction hash is generated based on the message + signature

keccak256(message + signature)

Example Message

Asset Registry transaction

An update is being made to your inventory

Operations:

asset-link delete
- equipWith_asmBrain
- did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000
- did:fv-asset:1:evm:0x1ea66a857de297471bc12dd12d93853ff6617284:20
end

asset-link create
- equipWith_asmBrain
- did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000
- did:fv-asset:1:evm:0x1ea66a857de297471bc12dd12d93853ff6617284:21
end

asset-link create
- equipWith_gloves
- did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000
- did:fv-asset:1:root:0x1ea66a857de297471bc12dd12d93853ff6617284:21
end

delegate delete
- 0x6bca6de2dbdc4e0d41f7273011785ea16ba47182 (FPPass address - account 1)
- 0x6bca6de2dbdc4e0d41f7273011785ea16ba47183 (FPPass address - account 2)
end

ownership update
- did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000
- 0x6bca6de2dbdc4e0d41f7273011785ea16ba47182
end

asset-link create
- equipwith_hairStyle
- did:fv-asset:1:evm:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1000
- did:fv-asset:off-chain:0x6bca6de2dbdc4e0d41f7273011785ea16ba47182:1234
end

Operations END

Address: 0x854A3E045Ac44a7f4A1726AdAC576029135DFdA7
Nonce:1

Informal Message Template

A Bash-like informal template of the full message is presented below for readability and ease of understanding. Field descriptions are provided in the following section.

Asset Registry transaction

${statement}

Operations:
${operations[0]["type"]} ${operations[0]["action"]}
- ${operations[0]["args"][0]}
- ${operations[0]["args"][1]}
...
- ${operations[0]["args"][n]}

${operations[1]["type"]} ${operations[1]["action"]}
- ${operations[1]["args"][0]}
- ${operations[1]["args"][1]}
...
- ${operations[1]["args"][n]}
end

...

${operations[n]["type"]} ${operations[n]["action"]}
- ${operations[n]["args"][0]}
- ${operations[n]["args"][1]}
...
- ${operations[n]["args"][n]}
end

Operations END

Address: ${address}
Nonce: ${nonce}

Message Field Descriptions

ABNF

The message MUST conform with the following Augmented Backus–Naur Form (ABNF, RFC 5234) expression (note that %s denotes case sensitivity for a string term, as per RFC 7405).

artm = 
  %s"Asset Registry transaction" LF
  LF
  [ statement LF ]
  LF
  %s"Operations:" LF
  LF
  operations
  %s"Operations END" LF
  LF
  %s"Address: " address LF
  %s"Nonce: " nonce

statement = 1*( reserved / unreserved / " " ) ; The purpose is to exclude LF (line breaks).

operations = *operation

operation = operation-type SP operation-action LF 1*(operation-argument) %s"end" 2*2LF

operation-type = *(ALPHA / "-")

operation-action = *(ALPHA / "-")

operation-argument = "-" SP *VCHAR LF

address = "0x" 40HEXDIG

nonce = 1*DIGIT

; ------------------------------------------------------------------------------
; RFC 3986

unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
reserved      = gen-delims / sub-delims
gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
              / "*" / "+" / "," / ";" / "="

; ------------------------------------------------------------------------------
; RFC 5234

ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
LF             =  %x0A ; linefeed
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
DIGIT = %x30-39 ; 0-9
SP = %x20 ; space
VCHAR =  %x21-7E ; visible (printing) characters

Typescript Interface

interface ARTM {
	statement: string
	operations: {
		type: string
		action: string
		args: string[]
	}[],
	address: string
	nonce: number
	signature?: string
	transactionHash: string | null
	addSignature: () => void
	verify: () => boolean
}

Last updated

© 2023 -> ♾️