Updating the balance of a Payment Channel

Commitment Transactions

  • can be revoked (canceled) if both parties agree to do so
  • always spend from the 2-of-2 multisig Output of the Funding Transaction
Multiple Commitment Transactions inside a Payment Channel

Pay-Me-First Transaction

  • the beneficiary of the funds can only spend them after a “maturation” period has passed (is delayed)
  • the contract can be revoked (by the beneficiary)
  • if the contract was revoked and the beneficiary still tries to spend the funds then it risks penalty (loosing all the funds)
The Pay-Me-First transaction created by Alice

Pay-Other-First Transaction

The Pay-Other-First transaction created by Alice
The Pay-Other-First transaction created by Alice

Channel State Update — Step By Step

Alice Builds and Signs

Alice builds and signs her Pay-Me-First transaction
Alice builds and signs her Pay-Me-First transaction
  1. BuildPayMeFirstTx( alice) — Alice builds the transaction that pays her 0.08 BTC with no restrictions and 0.02 BTC to Bob under the RSM Contract. We name this transaction payAliceFirstTx.
  2. Sign(payAliceFirstTx) — Alice signs payAliceFirstTx transaction and creates a signature named payAliceFirstSignature.
  3. Send(payAliceFirstSignature) — Alice sends the payAliceFirstSignature to Bob. There is no risk for her sending this signature. The worst case scenario is that Bob will close the channel and will broadcast payAliceFirstTx, which is fine for Alice since she can spend her output right away, while Bob has to wait.
    By broadcasting payAliceFirstTx, Bob also discloses that he received the 0.02 BTC from Alice. If instead of closing the channel Bob becomes unresponsive then Alice can safely broadcast the previous transaction where she has a larger amount (State01) since she has not revoked the current commitment transaction yet.

Bob checks and revokes

Bob checks the signature from Alice and revokes the previous state
Bob checks the signature from Alice and revokes the previous state
Alice receives the revocation message for State01
Alice receives the revocation message for State01

Bob builds and signs

Bob builds and signs the Pay-Me-First transaction
Bob builds and signs the Pay-Me-First transaction

Alice checks and revokes

--

--

--

I'm trying to understand this stuff myself

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How The IRS Identified 10,000 Cryptocurrency Holders Who Received Warning Letters?

Permit Me to walk you through crodo.io Guide

Egretia — The World’s First HTML5 Blockchain Engine

ONTO and SUNT·DaoFi Are Hosting a $4,000 SUNT Hold & Earn Campaign!

Deep south in India, a ray of hope emerges for blockchain enthusiasts

Mismeasure of the Market: LongFin — one of the Four Horseman of the Great Crash of 2018 and its…

Bitcoin & Energy, Part 3: An opportunity for renewables

Kikoverse Biweekly Newsletter(02.10–02.23)

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
Vlad Stan

Vlad Stan

I'm trying to understand this stuff myself

More from Medium

A Ticket To Mars (December 2020)

Elon Musk Tesla Bitcoin Italiano — Review

The Failed to determine a suitable driver class

Yemen: UAE-backed forces charge into Marib after taking Shabwah from Houthis