Skip to content

Instantly share code, notes, and snippets.

@subhramazumdar
Last active June 8, 2020 18:18
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 subhramazumdar/cf7b043a73db136f6a23091d20e51751 to your computer and use it in GitHub Desktop.
Save subhramazumdar/cf7b043a73db136f6a23091d20e51751 to your computer and use it in GitHub Desktop.
To avoid the problem of reverse-griefing, we introduce an extra round before intiating the locking phase along with an extra commitment.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@subhramazumdar
Copy link
Author

Considering 2 deposits as 2 separate HTLC construct. Not sure whether they can be combined. I am still under doubt regarding this "If R broadcasts r, then C gets 1 msat and R gets 6 msat". Because if total deposit is 7 msat not sure if this can be redirected to two addresses.

@prabal-banerjee
Copy link

Both cancellation round and payment round contract contain "x" and "H(x)". Will this create a problem? (With access to x, a party can now choose to encash any one of the available contracts) (Can't think of a practical attack, but need to think more about this)

@subhramazumdar
Copy link
Author

Both cancellation round and payment round contract contain "x" and "H(x)". Will this create a problem? (With access to x, a party can now choose to encash any one of the available contracts) (Can't think of a practical attack, but need to think more about this)
Encash anyone as in either cancellation or payment?

@prabal-banerjee
Copy link

Encash anyone as in either cancellation or payment?

Yes.

@subhramazumdar
Copy link
Author

When a party goes-onchain, it will broadcast its output and all the unsolved HTLCs it has. So it is like if C and R has deposited each 50-50 msat as funding. Now C wants to transfer 1 msat to R. So first R locks 6 msat, the state of the channel is C: 50, R: 44 msat, HTLC: 6 msat. Next, when the payment round contract is established, the state of channel will be C: 49, R: 44 msat, HTLC: 6 msat, HTLC1: 1msat. So when R goes on-chain revealing x (vice versa for C): it can spend 44 msat, HTLC-output: 6msat and HTLC1-output: 1msat as well. Is this the case?

@subhramazumdar
Copy link
Author

So it will be like for R commitment tx definition: Input : funding tx, output: output 0: 49 msat (to spend by C), output 1: 44 msat (to be spend by R after block relative time), output2: HTLC(the corresponding script with R), output 3-HTLC1(the corresponding script with R)

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