Hacker News new | ask | show | jobs
by DennisP 3081 days ago
You're basically right except with payment channels you mostly don't have to trust the counterparty.

The simplest case is a unidirectional channel. To pay you a series of micropayments, I send a series of transactions with each one slightly larger, so each is the sum of all my payments. You can only submit one such transaction to the blockchain. I lock my funds so you don't have to worry they won't be available.

Bidirectional channels and networking are elaborations on this idea. In bidirectional channels the main risk is that your counterparty will submit an obsolete state; there has to be a delay and you have to monitor the chain so you can submit a more recent state if that happens. You don't have to know who the counterparty is.

(Your analogy to a ledger with account balances is precisely correct for Ethereum, but Bitcoin actually has a somewhat different model.)

1 comments

If I'm reading you, the idea is to essentially to negotiate out-of-band? I remember reading something like this in Bitcoin and Cryptocurrency Technologies with a note saying nobody had tried it in practice.

> (Your analogy to a ledger with account balances is precisely correct for Ethereum, but Bitcoin actually has a somewhat different model.)

My understanding is that in bitcoin it's a log of transactions -- a ledger. Ethereum is instead addresses holding totals -- more like an account statement.

Unidirectional payment channels are currently live on Ethereum. Here's a full explanation of those, along with bidirectional and networked channels, with Solidity sample code: http://www.blunderingcode.com/a-lightning-network-in-two-pag...

I guess I've been misusing the term "ledger." You're exactly right for Ethereum. Bitcoin has transactions with "unspent outputs." Each transaction can have multiple inputs and outputs; to make a transaction you collect unspent outputs from previous transactions, use them as your inputs, and typically make two outputs, one to the payee address and one that holds the change.