Flow reference: Utility & Web

Crypto Wallet

Your own Litecoin wallet (recovery phrase in a bot secret): an address per index, check a payment, read the balance or send coins, e.g. for an automatic middleman.

Your own Litecoin wallet (recovery phrase in a bot secret): an address per index, check a payment, read the balance or send coins, e.g. for an automatic middleman.

When and how to use it

Create a new wallet only for this bot (for example in Electrum-LTC) and write down its 12 or 24 recovery words.
Open Bot → Settings, add a secret setting named WALLET_PHRASE and paste the words there. Keep {env.WALLET_PHRASE} in the block: a phrase typed into the block would be saved as plain text in the flow, and the validator warns about it.
Give every deal its own index (for example a counter saved in storage). Each index is its own address: m/84'/2'/0'/0/<index>, the same addresses Electrum-LTC shows for that phrase.
An automatic middleman: Get address → show {wallet.address} to the buyer; a "Check payment" button runs Check payment for that index (paid releases the deal, waiting tells the buyer to wait); when both sides agree, Send coins with amount all to the seller's address.

Configuration fields

Operation — operation


What the block does. address gives the address of the index (no network call). check compares what the address received with the expected amount. balance reads what the address holds. send sends coins from that index's address.

Input: Fixed choice.

Default: address.

Available choices (preserve the exact value):
address — Get address
check — Check payment
balance — Read balance
send — Send coins


Coin — coin


The coin of the wallet. Litecoin for now; addresses are native SegWit (ltc1…).

Input: Fixed choice.

Default: ltc.

Available choices (preserve the exact value):
ltc — Litecoin (LTC)


Recovery phrase — phrase


The wallet's 12 or 24 BIP39 words, given as a reference to a secret bot setting. Whoever has the phrase owns the coins, so use a wallet made only for this bot and never paste the words into a block, a message or a log. The phrase is never put into a variable, the bot log or an error.

Input: Text with variable suggestions.

Format example, not a ready value for your server: {env.WALLET_PHRASE}.

Default: {env.WALLET_PHRASE}.


Address index — index


A whole number from 0 to 2147483647, or a {variable}. Every index is a different address of the same wallet, so one index per deal keeps payments apart. Send only spends the coins of this index's address.

Input: Text with variable suggestions.

Format example, not a ready value for your server: {deal.index}.

Default: 0.


Amount in LTC (check / send) — amount


Check: the amount the address must have received, in LTC (0.5, 0,5 and 0.5 LTC all work; it is compared in litoshis, never with rounding errors). Send: the amount to send, or all to send everything on that index's address minus the network fee. A send for more than the address holds (with the fee) takes failed with "za mało środków".

Input: Text with variable suggestions.

Format example, not a ready value for your server: 0.5.

Default: ``.


Send to (send only) — to


The Litecoin address the coins go to: ltc1… (SegWit or Taproot) or L…/M… (legacy). The address and its checksum are checked before anything is signed; anything else takes failed. A fixed amount sends the change back to the same index address.

Input: Text with variable suggestions.

Format example, not a ready value for your server: ltc1q….

Default: ``.


Confirmations (check only) — confirmations


How many blocks the payment needs before Check payment takes paid (a Litecoin block comes about every 2.5 minutes). 0 accepts a payment still waiting in the mempool, which the sender could still replace; 1 or more is safer for larger amounts.

Input: Text.

Default: 1.


Store as — storeAs


The prefix of the variables the block sets. With the default: {wallet.address}, {wallet.index}, {wallet.received} (LTC received from others), {wallet.balance} (confirmed + unconfirmed), {wallet.confirmations} (of the newest incoming payment), {wallet.txid} (the incoming payment for check and balance, the new transaction for send), {wallet.fee} and {wallet.sent} (send) and {wallet.error} (a short reason on failed).

Input: Text.

Default: wallet.

Outputs and next steps

out: Get address, Read balance or Send coins finished; the variables are set.
paid: Check payment: the address received at least the amount with enough confirmations.
waiting: Check payment: not enough has arrived (or it is not confirmed yet); check again later.
failed: Something went wrong (wrong phrase, index, amount or address, not enough coins, the network did not answer); {wallet.error} says what. Nothing was sent.

Only the outputs of the chosen operation are drawn on the canvas.

Test and troubleshoot

The Live Preview never touches the wallet or the network: it makes up an address per index, answers waiting the first time a flow checks an index and paid the next time, and makes up a transaction for a send. Test real payments with a small amount first, and keep the wallet's recovery words offline as a backup.



Save, validate and publish. Perform one real test and read the first relevant log error. [Testing](/docs/flow-testing) · [Variables](/docs/flow-variables) · [Permissions](/docs/flow-permissions).