Ethereum Payment Channel in 50 Lines of Code

The function Alice can call to terminate the channel. Seeing as it requires both signatures, Bob cannot single-handedly close it and cheat Alice out of work she’s already done.
Timeout function to protect Bob from being extorted

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store