# Protobuf Documentation

# Table of Contents

Top

# regen/data/v1alpha2/types.proto

# Content

Content is a wrapper for content stored on-chain

Field Type Label Description
raw_data bytes raw_data is the oneof field for raw data

# ContentHash

ContentHash specifies a hash based content identifier for a piece of data

Field Type Label Description
raw ContentHash.Raw Raw specifies "raw" data which does not specify a deterministic, canonical encoding. Users of these hashes MUST maintain a copy of the hashed data which is preserved bit by bit. All other content encodings specify a deterministic, canonical encoding allowing implementations to choose from a variety of alternative formats for transport and encoding while maintaining the guarantee that the canonical hash will not change. The media type for "raw" data is defined by the MediaType enum.
graph ContentHash.Graph Graph specifies graph data that conforms to the RDF data model. The canonicalization algorithm used for an RDF graph is specified by GraphCanonicalizationAlgorithm.

# ContentHash.Graph

Graph is the content hash type used for RDF graph data

Field Type Label Description
hash bytes hash represents the hash of the data based on the specified digest_algorithm
digest_algorithm DigestAlgorithm digest_algorithm represents the hash digest algorithm.
canonicalization_algorithm GraphCanonicalizationAlgorithm graph_canonicalization_algorithm represents the RDF graph canonicalization algorithm.
merkle_tree GraphMerkleTree merkle_tree is the merkle tree type used for the graph hash, if any

# ContentHash.Raw

Raw is the content hash type used for raw data

Field Type Label Description
hash bytes hash represents the hash of the data based on the specified digest_algorithm
digest_algorithm DigestAlgorithm digest_algorithm represents the hash digest algorithm.
media_type MediaType media_type represents the MediaType for raw data.

# SignerEntry

SignerEntry is a signer entry wrapping a signer address and timestamp

Field Type Label Description
signer string signer is the address of the signer
timestamp google.protobuf.Timestamp timestamp is the time at which the data was signed

# DigestAlgorithm

DigestAlgorithm is the hash digest algorithm

Name Number Description
DIGEST_ALGORITHM_UNSPECIFIED 0 unspecified and invalid
DIGEST_ALGORITHM_BLAKE2B_256 1 BLAKE2b-256

# GraphCanonicalizationAlgorithm

GraphCanonicalizationAlgorithm is the graph canonicalization algorithm

Name Number Description
GRAPH_CANONICALIZATION_ALGORITHM_UNSPECIFIED 0 unspecified and invalid
GRAPH_CANONICALIZATION_ALGORITHM_URDNA2015 1 URDNA2015 graph hashing

# GraphMerkleTree

GraphMerkleTree is the graph merkle tree type used for hashing, if any

Name Number Description
GRAPH_MERKLE_TREE_NONE_UNSPECIFIED 0 no merkle tree

# MediaType

MediaType defines MIME media types to be used with a ContentHash.Raw hash.

Name Number Description
MEDIA_TYPE_UNSPECIFIED 0 MEDIA_TYPE_UNSPECIFIED can be used for raw binary data
MEDIA_TYPE_TEXT_PLAIN 1 plain text
MEDIA_TYPE_JSON 2 JSON
MEDIA_TYPE_CSV 3 CSV
MEDIA_TYPE_XML 4 XML
MEDIA_TYPE_PDF 5 PDF
MEDIA_TYPE_TIFF 16 TIIF
MEDIA_TYPE_JPG 17 JPG
MEDIA_TYPE_PNG 18 PNG
MEDIA_TYPE_SVG 19 SVG
MEDIA_TYPE_WEBP 20 WEBP
MEDIA_TYPE_AVIF 21 AVIF
MEDIA_TYPE_GIF 22 GIF
MEDIA_TYPE_APNG 23 APNG
MEDIA_TYPE_MPEG 32 MPEG
MEDIA_TYPE_MP4 33 MP4
MEDIA_TYPE_WEBM 34 WEBM
MEDIA_TYPE_OGG 35 OGG

Top

# regen/data/v1alpha2/events.proto

# EventAnchorData

EventAnchorData is an event emitted when data is anchored on-chain.

Field Type Label Description
iri string iri is the data IRI

# EventSignData

EventSignData is an event emitted when data is signed on-chain.

Field Type Label Description
iri string iri is the data IRI
signers string repeated signers are the addresses of the accounts which have signed the data.

# EventStoreRawData

EventStoreRawData is an event emitted when data is stored on-chain.

Field Type Label Description
iri string iri is the data IRI

Top

# regen/data/v1alpha2/genesis.proto

# GenesisContentEntry

GenesisContentEntry is a genesis content entry

Field Type Label Description
hash ContentHash hash is the ContentHash
timestamp google.protobuf.Timestamp timestamp is the anchor Timestamp
signers SignerEntry repeated signers are the signers, if any
content Content content is the actual content if stored on-chain

# GenesisState

GenesisState is the genesis state

Field Type Label Description
entries GenesisContentEntry repeated entries are the content entries

Top

# regen/data/v1alpha2/query.proto

# ContentEntry

ContentEntry describes data referenced and possibly stored on chain

Field Type Label Description
hash ContentHash hash is the content hash
iri string iri is the content IRI
timestamp google.protobuf.Timestamp timestamp is the anchor Timestamp
signers SignerEntry repeated signers are the signers, if any
content Content content is the actual content if stored on-chain

# QueryByHashRequest

QueryByContentHashRequest is the Query/ByContentHash request type.

Field Type Label Description
hash ContentHash hash is the hash-based identifier for the anchored content.

# QueryByHashResponse

QueryByContentHashResponse is the Query/ByContentHash response type.

Field Type Label Description
entry ContentEntry entry is the ContentEntry

# QueryBySignerRequest

QueryBySignerRequest is the Query/BySigner request type.

Field Type Label Description
signer string signer is the address of the signer to query by.
pagination cosmos.base.query.v1beta1.PageRequest pagination is the PageRequest to use for pagination.

# QueryBySignerResponse

QueryBySignerResponse is the Query/BySigner response type.

Field Type Label Description
entries ContentEntry repeated entries is the ContentEntry's signed by the queried signer
pagination cosmos.base.query.v1beta1.PageResponse pagination is the pagination PageResponse.

# Query

Query is the regen.data.v1alpha1 Query service

Method Name Request Type Response Type Description
ByHash QueryByHashRequest QueryByHashResponse ByHash queries data based on its ContentHash.
BySigner QueryBySignerRequest QueryBySignerResponse BySigner queries data based on signers.

Top

# regen/data/v1alpha2/tx.proto

# MsgAnchorDataRequest

MsgAnchorDataRequest is the Msg/AnchorData request type.

Field Type Label Description
sender string sender is the address of the sender of the transaction. The sender in StoreData is not attesting to the veracity of the underlying data. They can simply be a intermediary providing services.
hash ContentHash hash is the hash-based identifier for the anchored content.

# MsgAnchorDataResponse

MsgAnchorDataRequest is the Msg/AnchorData response type.

Field Type Label Description
timestamp google.protobuf.Timestamp timestamp is the timestamp of the block at which the data was anchored.

# MsgSignDataRequest

MsgSignDataRequest is the Msg/SignData request type.

Field Type Label Description
signers string repeated signers are the addresses of the accounts signing the data. By making a SignData request, the signers are attesting to the veracity of the data referenced by the cid. The precise meaning of this may vary depending on the underlying data.
hash ContentHash.Graph hash is the hash-based identifier for the anchored content. Only RDF graph data can be signed as its data model is intended to specifically convey semantic meaning.

# MsgSignDataResponse

MsgSignDataResponse is the Msg/SignData response type.

# MsgStoreRawDataRequest

MsgStoreRawDataRequest is the Msg/StoreRawData request type.

Field Type Label Description
sender string sender is the address of the sender of the transaction. The sender in StoreData is not attesting to the veracity of the underlying data. They can simply be a intermediary providing services.
content_hash ContentHash.Raw content_hash is the hash-based identifier for the anchored content.
content bytes content is the content of the raw data corresponding to the provided content hash.

# MsgStoreRawDataResponse

MsgStoreRawDataRequest is the Msg/StoreRawData response type.

# Msg

Msg is the regen.data.v1alpha1 Msg service

Method Name Request Type Response Type Description
AnchorData MsgAnchorDataRequest MsgAnchorDataResponse AnchorData "anchors" a piece of data to the blockchain based on its secure hash, effectively providing a tamper resistant timestamp.

The sender in AnchorData is not attesting to the veracity of the underlying data. They can simply be a intermediary providing timestamp services. SignData should be used to create a digital signature attesting to the veracity of some piece of data. | | SignData | MsgSignDataRequest | MsgSignDataResponse | SignData allows for signing of an arbitrary piece of data on the blockchain. By "signing" data the signers are making a statement about the veracity of the data itself. It is like signing a legal document, meaning that I agree to all conditions and to the best of my knowledge everything is true. When anchoring data, the sender is not attesting to the veracity of the data, they are simply communicating that it exists.

On-chain signatures have the following benefits: - on-chain identities can be managed using different cryptographic keys that change over time through key rotation practices - an on-chain identity may represent an organization and through delegation individual members may sign on behalf of the group - the blockchain transaction envelope provides built-in replay protection and timestamping

SignData implicitly calls AnchorData if the data was not already anchored.

SignData can be called multiple times for the same content hash with different signers and those signers will be appended to the list of signers. | | StoreRawData | MsgStoreRawDataRequest | MsgStoreRawDataResponse | StoreRawData stores a piece of raw data corresponding to an ContentHash.Raw on the blockchain.

StoreRawData implicitly calls AnchorData if the data was not already anchored.

The sender in StoreRawData is not attesting to the veracity of the underlying data. They can simply be a intermediary providing storage services. SignData should be used to create a digital signature attesting to the veracity of some piece of data. |

# Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)