# Transactions

> How PRL moves: a transaction spends outputs you own, creates new ones (with change), proves ownership with a signature and pays a fee to the miner.

Source: https://pearlcodex.com/beginners/transactions/ · Last updated: 2026-10-20 · Checked against Pearl's source code at v1.5.5

A [transaction](https://pearlcodex.com/glossary/#transaction) is a short message with a big job: it moves PRL from one owner to another.

It says which coins are being spent, who gets them, and it carries a signature proving the owner agreed. That’s all. There are no account numbers and no names.

## What’s inside a transaction?

Two lists.

[Inputs](https://pearlcodex.com/glossary/#input) point to coins you already have. [Outputs](https://pearlcodex.com/glossary/#output) create new coins for whoever is being paid.

Every coin in the ledger is an output of some earlier transaction. Until someone spends it, it’s an unspent transaction output, or [UTXO](https://pearlcodex.com/glossary/#utxo). Your wallet balance is simply the total of all the UTXOs your keys can unlock.

So a transaction is a little act of recycling: it uses up some old outputs and creates fresh ones.

## Why do you get change?

Outputs work like banknotes. You can’t tear one in half, so when you spend an output, you spend all of it.

Say you hold one output worth 10 PRL and want to pay a friend 3 PRL. Your transaction spends the whole 10 PRL output and creates two new ones: 3 PRL for your friend, and the rest back to you. That second output is your [change](https://pearlcodex.com/glossary/#change).

Here is a real payment from block 130,825, drawn as boxes.

_A real Pearl payment (TXID d919e02a…) from block 130,825. The amounts are from the chain. The chain doesn’t label change; the round 2 PRL is almost certainly the payment._

Add up the outputs and you get `4.95646640 PRL`. The input held `4.95654555 PRL`. Keep that small gap in mind; it comes back in a moment.

**Make a guess:** You hold exactly one output, worth 10 PRL, and want to pay a friend 3 PRL. How many outputs will your transaction create?

**Answer:** Two.

One output of 3 PRL for your friend, and one change output back to you for a little under 7 PRL. The “little under” is the fee. Your old 10 PRL output is now spent and can never be spent again.

## How do you prove the coins are yours?

Every output is locked to a key. To unlock it, the spender attaches a [signature](https://pearlcodex.com/glossary/#signature) made with the matching private key. Pearl uses Schnorr signatures, 64 bytes each.

Any node can check the signature using the public key. And a signature only fits the exact transaction it was made for. Change a single grain of any amount, or swap the recipient’s address, and the signature no longer checks out.

That’s why nobody can intercept your payment and redirect it. They’d need to sign a new one, and only your private key can do that.

The signatures travel in a separate section of the transaction called the [witness](https://pearlcodex.com/glossary/#witness). Every spend on Pearl has one.

## Where does a transaction wait?

A signed transaction hops from node to node, and each node keeps a copy in its [mempool](https://pearlcodex.com/glossary/#mempool), a waiting room for valid transactions that aren’t in a block yet.

When a miner builds its next block, it picks transactions from its mempool. Once yours is in a block, it’s recorded in the ledger.

## Why pay a fee?

Remember the gap in the real example? The outputs add up to 7,915 grains less than the input. That difference is the [fee](https://pearlcodex.com/glossary/#fee).

Nobody writes the fee down. It’s simply left over, and the miner who includes the transaction claims it as part of the block’s reward.

Space in a block is limited: at most 1,000,000 [vbytes](https://pearlcodex.com/glossary/#vbyte). A vbyte is Pearl’s unit of size, where signature bytes count a quarter. Miners fill that space with the best-paying transactions first, so what matters is the fee per vbyte, called the [fee rate](https://pearlcodex.com/glossary/#fee-rate).

The example transaction was 154 vbytes, so its fee rate was about 51 grains per vbyte, which was typical for payments that day. Nodes won’t even pass on a transaction paying less than 1 grain per vbyte.

## What kinds of lock can an output have?

Pearl is strict here. Only three kinds of output are valid at all:

- **Taproot**, with addresses starting `prl1p`. Locked to one key, which can also hide extra spending rules. Almost every payment uses this.
- **P2MR**, with addresses starting `prl1z`. Locked to a tree of spending rules with no key in it. Rare today; the quantum safety page explains why it exists.
- **OP_RETURN**. Carries a piece of data and can never be spent.

Taproot and P2MR outputs smaller than 333 grains are called [dust](https://pearlcodex.com/glossary/#dust), because they’re worth so little that spending them would eat a large share of their value in fees. Nodes won’t pass on transactions that create them.

> **Pearl vs Bitcoin**
>
> The transaction format is Bitcoin’s, byte for byte. What changes is what’s allowed inside it:
>
> - Only Taproot, P2MR and OP_RETURN outputs are valid. Paying an old-style script (1…, 3…, bc1q…) makes the whole transaction invalid, not just non-standard.
> - No ECDSA: signatures are Schnorr, or optionally the post-quantum XMSS.
> - Sizes are measured in vbytes only. There are no weight units.
> - Dust is 333 grains, not 330.
> - Pearl’s reference wallet makes version 1 transactions and never signals replace-by-fee.

So a payment is now signed, checked and waiting. The next page shows how it gets locked into the ledger for good.

## In short

- A transaction spends existing outputs (its inputs) and creates new outputs for the people being paid.
- Outputs are spent whole, like banknotes, so the leftover comes back to you as change.
- A signature made with your private key proves you approved the exact transaction, and can’t be reused for any other.
- Signed transactions wait in each node’s mempool until a miner puts them in a block.
- The fee is whatever the inputs hold beyond the outputs. Miners prefer transactions with a higher fee per vbyte.

## Read the code

- [Only Taproot, P2MR and OP_RETURN outputs are valid](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/blockchain/validate.go#L220-L233) `node/blockchain/validate.go:220-233`
- [The minimum relay fee, 1 grain per vbyte](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/mempool/policy.go#L45-L50) `node/mempool/policy.go:45-50`
- [The dust limit (333 grains)](https://github.com/pearl-research-labs/pearl/blob/v1.5.5/node/mempool/policy.go#L137-L209) `node/mempool/policy.go:137-209`

## Sources

### Pearl source

- [Pearl source code at v1.5.5](https://github.com/pearl-research-labs/pearl/tree/v1.5.5)

### Bitcoin standards

- [BIP-341: Taproot](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki)

### Chain data

- [Example transaction d919e02a… on Pearl's Blockbook explorer](https://blockbook.pearlresearch.ai/tx/d919e02a4adfd739ceef31d98803f0ddd24e1b1fa67b0fe572cdec42c1b384c9)
