Here is the story of the MachinePay x402 protocol.
The Bank of MachinePay
Imagine a special bank in a world where privacy is everything. This bank doesn't have a big open vault; instead, every single user has their own personal, ultra-secure safe. Inside these safes, they store their golden coins.
The magic of this bank is that nobody can look inside anyone else's safe. Not the bank tellers, not other customers, not even a prying mayor.
The Two-Key Safes
Each safe in this bank is a marvel of engineering. It has two completely different ways to be opened:
The Personal Key (Your Key): You have a unique, personal key. You can use this key at any time to open a tiny peephole in your own safe, look inside, and count your coins. However, this key is "view-only"—it cannot be used to take coins out or put coins in. Only you have this key.
The Bank's Master Key (Their Keys): The front of the safe also has 11 keyholes. The only way to actually move coins is to get the bank's 11 "Governors" (the most trusted employees) to come at the same time. The bank actually has 16 of these Governors, but any 11 will do. When they all turn their keys together, the safe opens, allowing them to perform a transfer.
This two-key system is the bank's secret: You can view your balance privately, but only the bank can move your coins, and only when you ask.
How to Make a Secret Transfer
Let's say you (Alice) want to send 10 golden coins to your friend, Bob. You can't just shout "Send 10 coins to Bob!" because everyone would know your business.
Here is the two-day process you follow.
Day 1: Sending the Secret Request
Write the Note: You take a piece of paper and write a very specific, signed request: "I, Alice, authorize the bank to move 10 coins from my safe to Bob's safe. Signed, Alice." (This is your signed authorization).
The Magic Envelope: You don't just hand this note to a teller. You put it in a Magic Red Envelope. As soon as you seal it, the ink on the outside vanishes. The mailman who delivers it just sees a blank red envelope. He has no idea who sent it, who it's for, or what's inside.
The Inner Sanctum: This envelope is delivered to a special, high-security room in the bank. A manager (the BITE protocol) is the only one who can open it. He reads your note: "Ah, Alice wants to send 10 coins to Bob. Signature's good."
Schedule the Governors: The manager cannot move the coins himself. Instead, he posts a public bulletin: "Work Order #123: Governors, please assemble tomorrow to service Safe A (Alice's) and Safe B (Bob's)."
Notice what happened: The public saw a red envelope go in and a work order go up, but they have no idea how many coins are being moved. The "10 coins" part was read inside the secure room and passed to the Governors in a sealed, internal memo.
Day 2: The Governors Do the Work
The Governors Arrive: The next day, 11 of the bank's Governors (the Contract-Triggered Transaction) arrive with their keys. They have Work Order #123.
Open Safe A: They go to your safe (Alice's). All 11 put their keys in the 11 holes and turn. The safe opens. They look inside and see you have 100 coins.
Check the Memo: They check the secret internal memo: "Move 10 coins."
Perform the Logic: They ask: "Does Alice have 10 coins?" "Yes, she has 100." They take 10 coins out. They lock your safe. It now has 90 coins.
Open Safe B: They walk over to Bob's safe. All 11 use their keys to open it. They see he has 50 coins.
Complete the Transfer: They place your 10 coins inside Bob's safe and lock it. It now has 60 coins.
The Result: Total Privacy
Think about what anyone watching from the street saw:
They saw a blank, red envelope delivered on Day 1.
They saw 11 Governors move from one safe to another on Day 2.
No one ever saw:
How many coins you sent.
How many coins Bob received.
How many coins you had to begin with.
How many coins Bob had in his safe.
That is the secret of the Bank of MachinePay: confidential transactions (the Magic Envelope) and confidential balances (the 11-Key Safes).
Imagine a special bank in a world where privacy is everything.
This bank doesn't have a big open vault; instead, every single user has their own personal, ultra-secure safe. Inside these safes, they store their golden coins.
The magic of this bank is that nobody can look inside anyone else's safe. Not the bank tellers, not other customers, not even a prying mayor.
The Two-Key Safes
Each safe in this bank is a marvel of engineering. It has two completely different ways to be opened:
The Personal Key (Your Key): You have a unique, personal key. You can use this key at any time to open a tiny peephole in your own safe, look inside, and count your coins. However, this key is "view-only"—it cannot be used to take coins out or put coins in. Only you have this key.
The Bank's Master Key (Their Keys): The front of the safe also has 11 keyholes. The only way to actually move coins is to get the bank's 11 "Governors" (the most trusted employees) to come at the same time. The bank actually has 16 of these Governors, but any 11 will do. When they all turn their keys together, the safe opens, allowing them to perform a transfer.
This two-key system is the bank's secret: You can view your balance privately, but only the bank can move your coins, and only when you ask.
How to Make a Secret Transfer
Let's say you (Alice) want to send 10 golden coins to your friend, Bob. You can't just shout "Send 10 coins to Bob!" because everyone would know your business.
Here is the two-day process you follow.
Day 1: Sending the Secret Request
Write the Note: You take a piece of paper and write a very specific, signed request: "I, Alice, authorize the bank to move 10 coins from my safe to Bob's safe. Signed, Alice." (This is your signed authorization).
The Magic Envelope: You don't just hand this note to a teller. You put it in a Magic Red Envelope. As soon as you seal it, the ink on the outside vanishes. The mailman who delivers it just sees a blank red envelope. He has no idea who sent it, who it's for, or what's inside.
The Inner Sanctum: This envelope is delivered to a special, high-security room in the bank. A manager (the BITE protocol) is the only one who can open it. He reads your note: "Ah, Alice wants to send 10 coins to Bob. Signature's good."
Schedule the Governors: The manager cannot move the coins himself. Instead, he posts a public bulletin: "Work Order #123: Governors, please assemble tomorrow to service Safe A (Alice's) and Safe B (Bob's)."
Notice what happened: The public saw a red envelope go in and a work order go up, but they have no idea how many coins are being moved. The "10 coins" part was read inside the secure room and passed to the Governors in a sealed, internal memo.
Day 2: The Governors Do the Work
The Governors Arrive: The next day, 11 of the bank's Governors (the Contract-Triggered Transaction) arrive with their keys. They have Work Order #123.
Open Safe A: They go to your safe (Alice's). All 11 put their keys in the 11 holes and turn. The safe opens. They look inside and see you have 100 coins.
Check the Memo: They check the secret internal memo: "Move 10 coins."
Perform the Logic: They ask: "Does Alice have 10 coins?" "Yes, she has 100." They take 10 coins out. They lock your safe. It now has 90 coins.
Open Safe B: They walk over to Bob's safe. All 11 use their keys to open it. They see he has 50 coins.
Complete the Transfer: They place your 10 coins inside Bob's safe and lock it. It now has 60 coins.
The Result: Total Privacy
Think about what anyone watching from the street saw:
They saw a blank, red envelope delivered on Day 1.
They saw 11 Governors move from one safe to another on Day 2.
No one ever saw:
How many coins you sent.
How many coins Bob received.
How many coins you had to begin with.
How many coins Bob had in his safe.
That is the secret of the Bank of MachinePay: confidential transactions (the Magic Envelope) and confidential balances (the 11-Key Safes).