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

Every Day Crypto with xDAI

Move to Hodl Hodl: What is Hodl Hodl

NFT vs Money Laundering

Introducing Relay: The easiest way to send money to Africa with crypto

Some words about the MINE Network

NFT 101: A Practical Guide to NFTs for Beginners

POCR Airdrop Get 20 POCR + REF

EOS Name Exchange Market Report

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

X-PARALLEL SPACE : One -stop Financial Services for DeFi

Node crash course

Earn 20% APY on stablecoins? That’s what Anchor Protocol promises

Artrino Token,An Art Currency and A Mom Token, to List on BitMart Exchange