Payment Channels

There are so many privacy techniques, lets take a brief look at how each of them works from a higher level, looking at Zcash, Monero, Dash, Mixers (General)

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the newline's Introduction to Privacy on Ethereum course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to newline's Introduction to Privacy on Ethereum, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course newline's Introduction to Privacy on Ethereum

In this lesson, we are going to look at how state channels and payment channels work and how they provide privacy. So in a normal setting, if others want to send some currency to Bob, she will send a transaction to the blockchain, which will get mined and Bob will eventually receive the money. Now imagine that Leslie actually wants to send the money in many, many, many different transactions. So every minute, every second, she wants to give Bob like a fraction of the money instead of giving it all together or paying late. So instead, what she can do is she can use a payment channel. And how a payment channel works is by locking up funds in a contract. So what Alice will do is lock up the funds in a contract using a transaction. So let's say she locks up 10 currency. And now once the funds are locked, Bob is satisfied that he will get at least the amount that's locked in the contract. So Alice can now send sign messages to Bob as many as many as they are. And she can send them directly. So it doesn't actually interact with the blockchain in any way. So first of all, it's completely private. No one ever finds out how much money did Alice send to Bob or how many times they send it. They just know that some communication must have happened outside the blockchain. And if any of that is amelicious, the contract actually enforces that by time locks. And she can send as many sign messages to Bob and it's up to Bob when Bob wants to take the money out from the contract. So what Bob can do once he is satisfied and he doesn't want to wait any longer is he sends a transaction to the contract using the messages that he received. And the only thing that he needs to send is the latest message. He does not need to keep track of all the messages. He just needs to keep track of the latest message. Because in every message, the amount that he received gets increased. And therefore, he can send a transaction to the contract and claim the funds that is his. And this is very efficient because in terms of storage, he only has to keep the latest sign message from Alice. And if Alice tries to betray him and go to the contract, he can always use the message M and show that it's actually owned to Bob. And the contract will give them money to Bob and not to Alice. So this works fairly, fairly well and it provides very good privacy in terms that you never reveal the actual transactions, only the amount that you're taking out. But of course, it's not perfect. Okay. [ Silence ]