Transactions and blocks
A payment is a message, signed with your keys, that the whole network checks and then writes into the blockchain. This lesson follows one payment from the Send button to a block, and shows what the rest of the world can and cannot see about it.
What a transaction is
In Lesson 1 you learned that coins are entries on the blockchain. Each entry is called an output: an amount that belongs to some address. Kilonova lists a wallet's outputs under Wallet options, Coins.
A transaction spends one or more outputs you own (its inputs) and creates new outputs:
- one for the person you pay;
- one for your change, back to your own wallet;
- and a fee for the network.
A worked example. Your wallet holds one output of 0.5 XMR, and you pay Ravi 0.2 XMR:
INPUT OUTPUTS
┌────────────────────┐ ┌──────────────────────────────────┐
│ your output: 0.5 │────────────►│ to Ravi: 0.2 │
└────────────────────┘ │ change to you: 0.5 − 0.2 − fee │
│ fee: fee │
└──────────────────────────────────┘
the input is used up completely; what Ravi does not get comes back to youAn output is always spent whole, like paying with a banknote and getting change. Kilonova's Check before sending screen shows exactly these lines, read from the signed transaction itself: the recipient and amount, Network fee, Leaves this wallet (0.2 plus the fee) and Change back to this wallet.
Your wallet signs the transaction with your private spend key. The signature proves you are allowed to spend the input without revealing the key.
Fees
The fee pays the miners, the computers that bundle transactions into blocks. It depends on how big the transaction is in bytes, times a fee rate.
Monero counts in a tiny unit, the piconero: one XMR is 1,000,000,000,000 (10¹²) piconero. Fee rates are usually shown in piconero per byte. poolwatch labels them pN/B.
Kilonova offers four fee levels: Low, Normal, High and Urgent. As its send screen says, a higher fee only helps when blocks are full, and Normal is right almost always. A transaction cannot be cancelled once it is published, so you will never get a fee back.
The mempool: the waiting room
When you select Send now, your wallet hands the signed transaction to a node (a computer running the Monero software; Lesson 3 covers them). The node checks it and passes it on to other nodes. Until a miner puts it in a block, it waits in each node's mempool (memory pool).
your wallet ──► node ──► other nodes
│
▼
┌───────────────────┐ a miner picks transactions,
│ MEMPOOL │ usually the best-paying first
│ tx tx tx tx │ ───────────────────────────────► next block
│ tx YOURS tx │
└───────────────────┘poolwatch lets you look inside the mempool of a node you run. Its dashboard has one row per node:
| Column | What it tells you |
|---|---|
TXS | How many transactions are waiting now |
POOL SIZE | Their total size |
IN/MIN | New transactions seen in the last minute |
MED FEE/B | The median fee rate in the pool |
HEIGHT | The number of the node's latest block |
For a quick look without the full-screen view, poolwatch --once asks each node once and prints a report, in this form:
Monero (monero-main): OK
txs: <count>
pool size: <size>
height: <height>
top fee band: p90 <rate> pN/B (<count> tx)The detail view also shows median residency: how long the middle transaction in the pool has been waiting. See Read the dashboard and detail view.
Blocks and confirmations
About every two minutes, a miner publishes a block: a batch of transactions from the mempool, linked to the block before it. Every node checks the block and adds it to its copy of the chain. The transactions in it leave the mempool.
Each block after the one holding your transaction is one more confirmation. The deeper your transaction is buried, the harder it would be for anyone to rewrite history around it.
block 100 block 101 block 102 block 103
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ … YOURS │◄───│ │◄───│ │◄───│ │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
1 confirmation 2 3 4Monero adds a rule of its own: received coins can be spent only after 10 blocks, about 20 minutes. Until then Kilonova marks them Locked in the history.
Here is the same payment as Kilonova shows it on both sides:
| Moment | The sender sees | The receiver sees |
|---|---|---|
| Send now selected; the transaction is in the mempool | Sent. It confirms when the next block is mined. and Pending in History | +… XMR waiting for a block |
| A miner includes it in a block | The payment with its block number | The payment in History, marked Locked |
| 10 blocks later | The coins can be spent |
Why a transaction can wait
| Cause | What is happening | What to do |
|---|---|---|
| It missed the last block | The next block is a couple of minutes away | Wait |
| Many transactions at once | Blocks fill up and the best-paying go first | Wait. Monero's block size can grow when demand rises, so backlogs tend to clear |
| A very low fee during a busy time | Others outbid it | Next time choose a higher level; it only matters when blocks are full |
| Your wallet is not synced | It cannot build a transaction yet | Kilonova asks you to wait for Synced, block … |
| The node is unreachable | The transaction never reached the network | Kilonova reports it; nothing was sent |
What Monero keeps private
On many blockchains, anyone can read who paid whom and how much. Monero is designed so that an outside observer of the chain cannot. It uses three main techniques.
Stealth addresses hide the receiver. Your address never appears on the chain. For each payment, the sender's wallet works out a fresh one-time address from your public address. Only your private view key can recognise that output as yours. Two payments to the same address look unrelated.
Ring signatures hide the sender. Each input is signed together with a group of other outputs from the chain, called decoys. The signature proves that one of them is being spent, without showing which. Kilonova shows Choosing decoys and signing. Nothing is sent yet. while it does this. A key image, a tag unique to each output, lets nodes reject a second attempt to spend the same output without learning which output it is. poolwatch's double spends seen counts such attempts that a node has noticed.
RingCT hides the amounts. Amounts are stored as cryptographic commitments. Nodes can check that the inputs equal the outputs plus the fee, so no coins are created from nothing, without seeing any amount.
| On the chain, an observer can see | An observer cannot see |
|---|---|
| That a transaction happened, and when | Your address |
| Its size, and its fee | Which output was really spent |
| How many inputs and outputs it has | The amounts sent or received |
Strong, not absolute
These techniques protect what is written on the chain. They do not hide your IP address from the node you connect to, what you tell an exchange or a shop, or what someone with your view key can see. Researchers keep studying ways to guess decoys, and the protocol has been improved over time in response. Lesson 3 covers the parts that depend on you.
Stay safe
- Read the Check before sending screen every time: the address, the amount and the fee. A published payment cannot be reversed.
- Malware can swap an address in your clipboard for its own. Compare the first and last few characters of the address on the confirmation screen with the one you were given.
- On the real network, send a small amount first when you pay a new address.
In the apps
- Send and receive in Kilonova: Beginner guide.
- Fee levels and limits: Kilonova reference.
- Watch a mempool: poolwatch beginner guide.
Check yourself
Question 1 of 6
Your wallet holds one output of 0.5 XMR and you pay someone 0.2 XMR. What outputs does the transaction create?
What you learned
- A transaction spends whole outputs and creates new ones: the payment, your change, and a fee.
- Signed transactions wait in the mempool until a miner puts them in a block, about every two minutes.
- Each later block is a confirmation; Monero locks received coins for 10 blocks.
- Stealth addresses, ring signatures and RingCT hide the receiver, the sender and the amount on the chain, but not everything around it.