Ethereum Micropayment Channels

This is a repost of an answer I gave on the Ethereum StackExchange. It describes a simple micropayment channel implementation I’ve had bumping around in my head for the past week or so. I spent enough time writing it that I figured I’d share it here as well.

Q: What are payment channels? Can they be implemented on Ethereum?

Absolutely. In fact, there’s a project currently underway to implement an Ethereum Lightning Network, which uses micropayment transaction channels, called Raiden.

For those who aren’t already familiar with microtransaction channels, here’s a primer. Feel free to skip the next two paragraphs if you’re already familiar with the mechanism:

An RNG Method for Ethereum

Last night I was thinking about how to do random number generation¬†in Ethereum. It’s a difficult problem, given the fact that the blockchain is, and must be, public and deterministic. Using a future block hash can work in certain applications if the properties required of the selected block are kept secret until several blocks after the block has been mined. Even in this scenario, though, it’d be possible for a powerful malicious miner or consortium of miners to just consistently skew the distribution of random values and affect the overall outcome of an RNG-dependent dapp over the long haul. This especially becomes a problem under proof-of-stake, as computing capacity that might have otherwise had to go toward mining is freed up for block hash mutation.¬†Sophisticated users may notice the skew in such a scenario, but I expect most would not. Such a tactic might go unnoticed for a long time.