Giter Club home page Giter Club logo

Comments (14)

magomimmo avatar magomimmo commented on July 24, 2024

I retried the multi-hop payment from scratch and it's still unable to find a path between Alice and Charlie via Bob. My considerations are the following: In Stage 1 Bob is the only peer without any fund. Could he partecipate in a multi-hop payment without having any fund. Moreover, when Charlie open the channel with Bob, he asked to Bob a commitment of 200.000 satoshi, but he has no funds. How could it partecipate in the multi-hop payment?

from lightning-dev-site.

Roasbeef avatar Roasbeef commented on July 24, 2024

At the point where you attempted the multi-hop payment, if you do lncli describegraph, do you see 3 channel advertised? Due to a recent change, the channels are only fully advertised after 6 blocks.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

Yep. I discovered it this late afternoon by looking at the logs....But there is still something that IMHO is wrong. Bob has no funds in your scenario and the funding tx by Charlie ask for some fund from him.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

Hi @Roasbeef with 6 confirmations ii works, but I changed the values for the --push_amt to Alice, in such a way that Bob, the hop between Charlie and Alice, has enough funds in his channel with Alice. I'll try to redo this use case with the same values of the tutorial to see if I'm wrong. In such a case I'll close the issue. Thanks for your time.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

Hi @Roasbeef I confirm that if Bob does not have enough funds in his channel, he can't participate as an hop in the route between Charlie and Alice and this behavior seems to be correct to me. So, this mean that the tutorial has to be updated with correct funds for Bob.

from lightning-dev-site.

ndeet avatar ndeet commented on July 24, 2024

@magomimmo @Roasbeef
I tested everything from scratch. The tutorial works as long as we generate 6 blocks after opening the channels.
@magomimmo In my test it does not matter that Bob has no funds initially. I also thought after reading the docs that always both entities need to add funds to the funding tx. But it seems that it is also possible if only one entity adds funds. In the tutorial this is done by Alice and Charlie (Bob never adds any funds to the funding_tx, it seems).

I saw PR #16 is related to this issue but they are not referenced. What I do now.
@magomimmo Can you update your PR and only change the block generation to 6

btcctl --simnet --rpcuser=kek --rpcpass=kek generate 6

The other changes, especially for the amounts are not needed imo.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

@ndeet I'm pretty new to LN, so, I can be deadly wrong.

The following are the original values of the tutorial:

  • Alice opens a channel with Bob. She commits 1M satoshi, Bob 0 (first channel balance - aside from tx fee)
  • Bob adds an invoice of 10K Satoshi on that channel;
  • Alice pays the requested 10K; 990K Alice and 10K Bob is the updated channel's balance (aside from very marginal fee); The channel capacity is still 1M;

Then

  • Charlie open a channel with Bob. Charlie commits for 800K and Bob for 200K.

In my understanding this is only possible if Bob participates in a channel where his current balance is more than 200K, but in scenario of the tutorial he only has 10K in the channel with Alice. Unless LN requires that the limit amount for Bob to participate to a new opened channel is the sum of the capacity of all the channels he participates in.

The other this that's is still obscure to me is Who pays for the funding and the closing txs?

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

@ndeet I tested everything from scratch too and you're right even on the fact that Bob does not need to have enough funds on-chain to participate in an off-chain payment channel requiring him funds he does not own neither on_chain and neither off_chain. This is very very weird. I try the following: alice close the channel with bob and charlie close the channel with bob. At the end Bob has 210001K on chain, even if he only received a payment of 10k from Alice. there is something that I do not understand.....

from lightning-dev-site.

ndeet avatar ndeet commented on July 24, 2024

@magomimmo
Interesting, I think I know what is confusing you:

Note that this time, we supplied the --push_amt argument, which specifies the amount of money we want to other party to have at the first channel state.
It could be interpreted like you said. But I understand it this way: --push_amt is an initial amount which gets pushed to the other channel entity.

The lncli command help shows this:

--push_amt value the number of satoshis to push to the remote side as part of the initial commitment state (default: 0)

So this could be the reason why after closing the channel bob got this 200000 into his wallet. Maybe @Roasbeef can clarify the use case for this option.

@Roasbeef, can you also give some hints why not both entities are required to make a deposit on opening channels. Bob in our case has no penalty if he acts malicious?

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

@ndeet I dont' know what to say. I'll test what happen when the channel between Charlie and Bob is closed by Bob instead of being closed by Charlie and let you know.

Tested: when Bob close the channel initiated by Charlie with a push amount for him, he gets all of it as well. Weird. The only limitation I see on the push amount value is that it has to be less than the local amount.

BOLT 2 Specification says:

funding_satoshis is the amount the sender is putting into the channel. push_msat is an amount of initial funds that the sender is unconditionally giving to the receiver

The sender is the funder of the channel and the receiver is the fundee. In my understanding at the moment in the specification there is no an open_channel message able to required that both parties participate with their funds for establishing the payment channel. To me it seems that a very useful scenario.is missing.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

@ndeet @Roasbeef I wrote a major review of the Stage 1 Tutorial thta override the current Stage 1 PR. Could please take a look at it before I push the PR. Here il the link: https://github.com/magomimmo/lightning-dev-site/blob/major-stage-1-review/tutorial/01-lncli.md

Thanks so much to be patient

from lightning-dev-site.

ndeet avatar ndeet commented on July 24, 2024

Hi @magomimmo
thank you, you really did a lot of rewrite and additional information. As the changes are huge and I have some comments about inconsistencies / improvements I would prefer the following.

  • lets finish this issue by only pushing the changes so that the tutorial works as intended (by changing block generation to 6 after the channel openings
  • open a new issue + new PR with your major changes

This way we can have a working tutorial again without much review needed. And on the other hand your improvements can be checked and discussed in a separate issue + PR.

Currently with the changes sitting only in your branch I can't do inline comments (which is possible when there is a PR). I can see the diff here but can't comment:
master...magomimmo:major-stage-1-review

e.g. minor typo like this

btcct.conf is located under ~/.btcctl directory on POSIX OSes and under ~/Library/Application Support/Btcctl directory on MacOS.

--> btcct.conf should be btcctl.conf

And some other things like what the miner is all about etc should be discussed in a separate issue + PR where we can discuss directly on the code.

from lightning-dev-site.

magomimmo avatar magomimmo commented on July 24, 2024

Hi @ndeet I agree. Regarding your comment and fix, just fork my fork. When we're happy with the result we'll submit a separate issue + PR as you said.

Thanks so much for your time and suggestions....

from lightning-dev-site.

MaxFangX avatar MaxFangX commented on July 24, 2024

Looks like this is resolved. Thanks for the contributions!

from lightning-dev-site.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.