DocsRead the public ledger

DocsGuides22 of 33 · 2 min read

Read the public ledger

Read every payment as the chain has it, check one payment, and follow the whitelist's root.

The ledger is the public record: every payment's announcement, and the state of the whitelist. Reading it needs no wallet and no key.

App

Open /ledger.

The Whitelist panel shows how many recipients there are out of 16,777,216, the current root, the revision and how many roots are accepted.

The Payments table has one row per payment: time, transaction, stealth address, ephemeral key, audit ciphertext, whitelist root, and Verified under Proof. Press a row to open the payment.

SDK

ts
const { payments } = await liora.ledger();
const whitelist = await liora.whitelist();
const one = await liora.payment(signature, eventIndex);

None of these needs unlock.

CLI

bash
liora ledger
liora ledger --json

No keypair is needed.

API

bash
curl "$LIORA_API/v1/ledger"
curl "$LIORA_API/v1/whitelist"
curl "$LIORA_API/v1/ledger/$SIGNATURE"

#One payment

A payment's page lists its public fields in full:

FieldWhat you can check with it
Stealth addressThe one-time key that owns the payment. It appears once on the whole ledger
Ephemeral keyThe sender's one-time public value for this payment
Audit ciphertext64 bytes only the auditor can open
Whitelist rootThe revision of the whitelist the recipient was proved against
ProofVerified: the program checked the proof before emitting any of this
RecipientNot on chain
AmountEncrypted by Rings

Below the public view are two more: the recipient's, which opens when the unlocked wallet is the one that was paid, and the auditor's, which opens with the audit key.

#What the ledger lets you verify

  • Every payment listed passed its proof. The program emits an announcement only after verifying it.
  • Every payment went to a recipient who was on the whitelist at the root shown.
  • The size of the whitelist and each change to it. Every admission and removal is a WhitelistChanged event, and replaying them rebuilds the tree.

#Without the API

Everything on the ledger is in the program's events. To read it from an RPC node of your own, fetch the program's transactions with maxSupportedTransactionVersion: 1 and decode the inner instructions as Events describes. The program is 8i6Rs6mak6AoQH1Cd6asXpJoGMVqWP81iEux5kdnHbA4.