Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

$$ \newcommand \pk {\mathrm{pk}} \newcommand \fv {\text{first}} \newcommand \lv {\text{last}} \newcommand \Digest {\mathrm{Digest}} \newcommand \Encoding {\mathrm{Encoding}} \newcommand \Seed {\mathrm{Seed}} \newcommand \Record {\mathrm{Record}} \newcommand \DigestLookup {\mathrm{DigestLookup}} \newcommand \Stake {\mathrm{Stake}} \newcommand \Entry {\mathrm{Entry}} \newcommand \ValidEntry {\mathrm{ValidEntry}} \newcommand \Kcal {\mathcal{K}} $$

The Ledger of Entries

An entry is a pair \( e = (o, Q) \) where \( o \) is some opaque object, and \( Q \) is a 256-bit integer called a seed.

For a detailed definition of this object, see the Algorand Ledger Specification.

The following functions are defined on \( e \):

  • Encoding: \( \Encoding(e) = x \) where \( x \) is a variable-length bitstring.

  • Summarizing: \( \Digest(e) = h \) where \( h \) is a 256-bit integer. \( h \) should be a cryptographic commitment to the contents of \( e \).

A ledger is a sequence of entries \( L = (e_1, e_2, \ldots, e_n) \).

A round \( r \) is some 64-bit index into this sequence.

The following functions are defined on \( L \):

  • Validating: \( ValidEntry(L, o) = 1 \) if and only if \( o \) is valid with respect to \( L \). This validity property is opaque.

  • Seed Lookup: If \( e_r = (o_r, Q_r) \), then \( \Seed(L, r) = Q_r \).

  • Record Lookup: \( \Record(L, r, I_k) = (\pk_{k,r}, B_{k,r}, r_\fv, r_\lv) \) for some address \( I_k \), some public key \( \pk_{k,r} \), and some 64-bit integer \( B_{k,r} \). \( r_\fv \) and \( r_\lv \) define the first valid and last valid rounds for this participating account.

  • Digest Lookup: \( \DigestLookup(L, r) = \Digest(e_r) \).

  • Total Stake Lookup: We use \( \Kcal_{r_b,r_v} \) to represent all players with participation keys at \( r_b \) that are eligible to vote at \( r_v \). Let \( \Kcal_{r_b,r_v} \) be the set of all \( k \) for which \( (\pk_{k,r_b}, B_{k,r_b}, r_\fv, r_\lv) = \Record(L, r_b, I_k) \) and \( r_\fv \leq r_v \leq r_\lv \) holds. Then \( \Stake(L, r_b, r_v) = \sum_{k \in \Kcal_{r_b,r_v}} B_{k,r_b} \).

A ledger may support an opaque entry generation procedure:

$$ o := \Entry(L, Q) $$

which produces an object \( o \) for which \( \ValidEntry(L, o) = 1 \).

For implementation details on this procedure, see the block assembly section in the Algorand Ledger non-normative specification.