DocsReceive

DocsGuides18 of 33 · 2 min read

Receive

Find the payments made to you by scanning the ledger with your view key.

A payment to you is an announcement on the public ledger that looks like every other one. Your device finds yours by scanning: it tries each announcement with your keys.

You need to be unlocked. To be paid at all you need to be whitelisted.

App

Open Receive. The app scans when the page opens: it shows Scanning, with the line Reading announcements with your view key, and then the list under Received.

Each row has the time, the amount, the stealth address it arrived at and its state, Spendable or Spent. Scan again reads the ledger anew.

SDK

ts
const inbox = await liora.scan((state) => render(state.state));

The callback receives scanning. The call resolves to { state: "empty" } or a list:

json
[
  { "amountLamports": "250000000", "spendable": true, "signature": "YQ6s1fVTEXF9uivz2j5NPQbFrMaoA97fkBM6kH5vR2WJUBSiwDVXHQYY3vy7rffeswUyjWTrdcaSm9dMvD198FC" },
  { "amountLamports": "1250000000", "spendable": true, "signature": "3Bk4LAuEJc9LfagU6SXnYyU7wmi1HHgY79v5GojytBY8Jf1ENyaAMTGWUiChaRU7EPAYp6JHqyHT86qBtYTJYkeT" }
]

Each entry also carries the full announcement under payment. The example shows three of its fields.

CLI

bash
liora scan --keypair recipient.json

It prints the same list. liora balance totals what is spendable.

#What a scan does

Your device downloads every announcement and tries each one with your view key: it recomputes the shared secret, compares the view tag, and for the few that match checks whether the stealth address is one of yours. Then it opens the note to read the amount and checks whether it has been spent. Stealth addresses has the arithmetic.

The scan asks for the whole list and filters at home. The service that answers cannot tell which announcements you kept.

#One payment, opened

A payment you have the signature of can be opened by itself. On its ledger page, /ledger then the row, an unlocked recipient sees the amount beside the public fields. With the SDK:

ts
const opened = await liora.openPayment(signature, "recipient", eventIndex);

For a payment that is yours this returns the role recipient with the amount. For anyone else's it returns the public view.

#Spending it

A received payment is yours to spend at once. Each row in the app offers Pay onward and Withdraw, and Spend and withdraw covers both.

#If something looks wrong

What you seeWhyNext
No payments yet, but you were paidThe ledger has not indexed the payment yetScan again in a moment
INDEXER_PENDINGThe indexer is behind the chain, so balances are held backScan again in a moment
NOTE_INVALIDA note that matched your keys would not openScan again. If it persists, the sender's note was malformed
A row marked SpentYou already paid it onward or withdrew itNothing. It stays in the list as a record