Records
A record is a fundamental data structure for encoding user assets and application state.
Each account record contains information that specifies the record owner, its stored value, and its application state. Records in Beo are consumed and newly created from a transition function. A transaction will store multiple transitions, each of which is responsible for the consumption and creation of its individual records. Optionally, if the visibility
of an entry in the record is private
, it is be encrypted using the owner's address secret key.
Components of a Record
An Beo record is serialized in the following format:
owner
address
The address public key of the owner of the program record
data
Map<Identifier, Entry>
A data payload containing arbitrary application-dependent information. Each entry can either be public
or private
.
nonce
group
The serial number nonce of the program record
An example record:
{
owner: Beo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q.private,
amount: 100u64.private,
_nonce: 5861592911433819692697358191094794940442348980903696700646555355124091569429group.public
}
Owner
Beo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q
The record owner is an account address, and specifies the party who is authorized to spend the record.
Data
100u64.private
The record can encode arbitrary application information. The "amount" key is the data payload that the record carries. An entry which has a visibility
of private
is encrypted and stored on the ledger. This enables users to securely and privately transfer record data and values between one another over the public network. Only the sender and receiver with their corresponding account view keys are able to decrypt the private entries.
Nonce
5861592911433819692697358191094794940442348980903696700646555355124091569429group
The serial number nonce is used to create a unique identifier for each record, and is computed via a PRF evaluation of the address secret key ask of the owner and the record's serial number. For a practical demonstration of a record in Beo.
Diving into the Concepts
To understand how to use records, we must understand the design principles behind Beo. Autonomous Ledger Execution Offchain (Beo) is a layer-1 blockchain that combines general-purpose programmability with privacy by default. The core idea behind Beo is ZEXE or zero-knowledge execution initially written in this research paper in 2018. It first introduced the record model which extends the UTXO model from Zcash and enables storing and encrypting arbitrary data (user assets and application states), rather than just values of specific assets or tokens.
Privacy
There are generally four different types of privacy that relate to blockchains.
Beo fulfils three of them:
Initially, Beo was aiming for function privacy as well (as detailed in the original ZEXE paper) but decided against it as it would have led to worse performance and longer proving times.
Comparing state storage in blockchains
There are two main state models used in blockchains - UTXO (unspent transaction output) and the account model (introduced by Solana).
Beo uses a variation of the UTXO model - the record model.
Last updated