Post
Topic
Board Development & Technical Discussion
Re: Lightning Network -QA
by
Xynerise
on 13/04/2018, 11:14:29 UTC

maybe I  ask wrong question.

according to this tutorial https://dev.lightning.community/tutorial/01-lncli/
If I open channel from Alice to Bob - Alice can pay to Bob, right?
But how can I force Bob to put some satoshi in this channel? So Bob can pay back to Alice?


so, question is - how to force Bob to put some money into channel?
If I understood you correctly, Alice and Bob have a channel whose balance is essentially funded by Alice alone, and you want Bob to be able to send funds to Alice over the channel?
In that case it's impossible unless Bob has funds of his in the channel.
Eg
Alice and Bob open a channel.
Alice contributes 1 BTC, while Bob doesn't contribute anything (let's say Alice is Bob's employer),
Alice's balance in the channel is 1 BTC, while Bob's is 0.
Bob can't send any funds to Alice because he has no balance in the channel.
However, if after some transactions, Bob has more funds in the transaction eg Alice now has 0.6BTC while Bob owns 0.4 BTC, then Bob can send funds to Alice from his 0.4BTC balance.
If he has no balance in the channel initially then he can't send to someone else.
Also, the channel balance cannot be increased by just sending more bitcoins to the channel as the Lightning Network channels work on UTXOs, not balances or addresses, so if Bob sends 0.5 BTC to the multisig address that holds the channel funds, the channel balance will not be increased at all.

In the example in the tutorial, Bob had no Bitcoins (only Alice and Charlie got) so he can't send any in the channel.
After Alice sent him 10000 sats, he can send some of that back to Alice.
Alice had to create an invoice first, and send it to Bob, then Bob can pay the invoice thereby sending money to Alice.

Either that or you send some of the mining rewards to Bob's address BEFORE opening the channel so that he has enough money to send to Alice.

Edit: Now I understand what you're trying to achieve.
Right now the channel can only be funded by one person and is biased towards the funder (i.e if Alice opens the channel with 0.1 BTC, Alice has 0.1 BTC in the channel balance while Bob has 0.) so they're unilateral at startup even though they're technically bilateral meaning that Bob can send Alice money back once he has received money from Alice.
There's currently a work in progress for implementing "dual funded" channels where Alice and Bob both construct the funding transaction so they both start out with balances equal to the amount they funded.

Till that is implemented you can use
Code:
push_msat