Skip to content

Instantly share code, notes, and snippets.

@u2
Created May 13, 2019 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save u2/f71ff873f7fc6dc96357618d59edffcf to your computer and use it in GitHub Desktop.
Save u2/f71ff873f7fc6dc96357618d59edffcf to your computer and use it in GitHub Desktop.
lightning
revoked commitment transaction
@u2
Copy link
Author

u2 commented May 13, 2019

steps:

  1. Creating an Unsigned Funding Transaction
  2. Spending from an Unsigned Transaction: SIGHASH NOINPUT

@u2
Copy link
Author

u2 commented May 13, 2019

第一个问题:需要区分是那个人提交的
第二个问题:需要能撤销

问题:

  1. SIGHASH NOINPUT
  2. ckb增加timestop 来判断网络是否拥堵

https://news.ycombinator.com/item?id=16125185
闪电网络和plasma mvp的挑战周期等都对这个有依赖。

@u2
Copy link
Author

u2 commented May 13, 2019

A miner can elect to define the block as a congested block or not. The
default code could automatically set the congested block flag as “1” 
if the mempool is above some size and the average fee for that set size is above
some value. However, a miner has full discretion to change the rules on
what automatically sets as a congested block, or can select to permanently
set the congestion flag to be permanently on or off. It’s expected that most
honest miners would use the default behavior defined in their miner and not
organize a 51% attack.

For example, if a parent transaction output is spent by a child with a
nSequence value of 10, one must wait 10 confirmations before the transaction
becomes valid. However, if the timestop flag has been set, the counting of
confirmations stops, even with new blocks. If 6 confirmations have elapsed
(4 more are necessary for the transaction to be valid), and the timestop
block has been set on the 7th block, that block does not count towards the
nSequence requirement of 10 confirmations; the child is still at 6 blocks for
the relative confirmation value. Functionally, this will be stored as some
kind of auxiliary timestop block height which is used only for tracking the
timestop value. When the timestop bit is set, all transactions using an nSequence
value will stop counting until the timestop bit has been unset. This
gives sufficient time and block-space for transactions at the current auxiliary
timestop block height to enter into the blockchain, which can prevent
systemic attackers from successfully attacking the system.

@u2
Copy link
Author

u2 commented May 13, 2019

 If
they do not broadcast their most recent version, they will be penalized by
taking all the funds in the channel and giving it to the counterparty. Since
their own funds are encumbered in their own RSMC, they will only be
able to claim their funds after some set number of confirmations after the
Commitment Transaction has been included in a block (in our example,
1000 confirmations). If they do broadcast their most recent Commitment
Transaction, there should be no revocation transaction superseding the
revocable transaction, so they will be able to receive their funds after some
set amount of time (1000 confirmations)

这里应该不能惩罚吧?

@u2
Copy link
Author

u2 commented May 13, 2019

P24

@u2
Copy link
Author

u2 commented May 13, 2019

3.3.5 Process for Creating Revocable Commitment Transactions

流程再看看。

@u2
Copy link
Author

u2 commented May 13, 2019

@u2
Copy link
Author

u2 commented May 13, 2019

到P32

@u2
Copy link
Author

u2 commented May 13, 2019

@u2
Copy link
Author

u2 commented May 14, 2019

第四章后面暂时没有看,关于“跳”部分暂时不实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment