Who really builds a block?
Proposer-builder separation, PBS, splits block making into two jobs: specialist builders put blocks together, and the proposer only picks one and signs it. The block is sold in an auction every slot.
It shapes who holds power over the order of transactions. Today you run a sealed-bid auction on the toy chain and see who is paid what.
By the end of this lesson
Note
I can pick the winning bid in a proposer-builder auction and say who does what.
Key words
| Word | What it means |
|---|---|
| Proposer | the validator whose turn it is to add the next block |
| Builder | a specialist that assembles a whole block and bids for it |
| Relay | a go-between that checks blocks and passes bids on |
| Sealed bid | a bid no other bidder can see |
| Payment | what the winning builder pays the proposer |
The cells students fill in are left blank in this preview.
Three roles: builder, relay and proposer
Builders read the mempool and private order flow and choose transactions. They put them in the order that earns most and bid to have their block used.
A relay sits in the middle. It checks each block is valid and passes only the bid and a header to the proposer, not the transactions. The proposer picks the highest bid and signs the header, then the relay releases the full block.
Worked example: who does what
| Role | Sees the transactions | Decides | Is paid |
|---|---|---|---|
| Builder | Yes | Which transactions and their order | Block value minus its bid |
| Relay | Yes | Whether a block is valid | Nothing in the toy |
| Proposer | No, until it signs | Which bid wins | The winning bid |
The cells students fill in are left blank in this preview.
The block is sold in a sealed-bid auction
Each builder works out what its block is worth to it, its value, and offers the proposer part of that, its payment. No builder sees another's bid.
In the lab, a block may hold at most 4 transactions. The relay refuses east, which offers 160 for a block worth only 150, and south, whose block holds 6. North pays 90, the most of the valid bids, and wins.
Run the sealed-bid auction
docker exec jupyter python3 steps/auction.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Worked example: the four bids
| Builder | Value | Payment | Transactions | Relay passes |
|---|---|---|---|---|
| north | 120 | 90 | 4 | Yes, and wins |
| east | 150 | 160 | 3 | No, pays more than its value |
| south | 110 | 95 | 6 | No, too many transactions |
| west | 100 | 70 | 2 | Yes |
The cells students fill in are left blank in this preview.
Try it: what each builder keeps
bids = {"north": [120, 90], "west": [100, 70]}
for name in bids:
value = bids[name][0]
payment = bids[name][1]
print(name, "would pay the proposer", payment, "and keep", value - payment)
# Add "quay": [140, 100] to bids and run again.
# Which bid should the proposer pick, and what does quay keep?
Why separate the jobs, and what it costs
Building a block that earns most needs heavy software and fast access to order flow. Separation lets a small proposer earn the same as a large one, without running any of it.
The cost is trust and concentration. A few builders can decide what goes in most blocks, and a relay is trusted to release the block it promised. Lesson 6 measures that concentration.
A common mistake
Warning
Many people think the proposer chooses the transactions in its block. Under PBS it only picks the highest valid bid and signs a header it cannot read. The builder chose the transactions and their order.