Bitcoin Forum
May 24, 2024, 07:22:37 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Lightning Network over mempool using Replace By Fee  (Read 223 times)
coinlatte (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 16


View Profile
February 19, 2020, 12:15:26 PM
 #1

Now we need two transactions: first to open a channel and second to close it. We can get rid of it if all transactions will be transmitted to the network. These transactions will have low sequence number (RBF enabled) and will have lock time in the future. Instead of opening the channel, Alice will send her transaction to Bob. She will be sure that no miner will include it before locktime. When Bob will see a transaction from Alice in mempool, he can send it to Charlie in the same way. Then, we will see a chain of such transactions in mempool: Alice->Bob->Charlie. All of these transactions will have RBF enabled, so Alice can create transaction sending her coins directly to Charlie (given these two transactions as a proof any miner can see it is not a double-spending attempt and accept such replacement). She has incentive to do that, because all such transactions have to contain at least minimal fee 1 satoshi/byte to be relayed over the network. One combined transaction always will be smaller than two separate transactions, so Alice can set a bit higher fee and still get some satoshi as a reward. Miners will also have incentive to accept that, because in this way they can include more transactions in the same block getting a bit higher satoshi per byte reward.

As a result, we can reduce everything into one transaction, sending all funds to all parties. I also thought about reducing it to zero transactions, but miners probably would still want to get some fee for accepting transaction replacements and that is why at least one transaction would be necessary. This idea also eliminates the need for being online 24/7 and creating watchtowers, as all channels' state will be publicly available.
Rath_
aka BitCryptex
Legendary
*
Offline Offline

Activity: 1876
Merit: 3132



View Profile
February 19, 2020, 12:51:17 PM
Merited by Quickseller (2), ABCbits (1)
 #2

Instead of decreasing the load on the blockchain, you are increasing the load on the nodes and the network.

Then, we will see a chain of such transactions in mempool: Alice->Bob->Charlie.

Imagine tens of thousands of such or longer chains in the mempool. Who's going to have enough memory to store all of them to ensure that none of them is dropped?

Instead of opening the channel, Alice will send her transaction to Bob. She will be sure that no miner will include it before locktime. When Bob will see a transaction from Alice in mempool, he can send it to Charlie in the same way.

Let's say Alice wants to buy something from Charlie. Once Charlie receives the timelocked transaction from Bob, he sends Alice what she ordered. What prevents Alice from spending one of the inputs of the timelocked transaction before it is included in any block?

All of these transactions will have RBF enabled, so Alice can create transaction sending her coins directly to Charlie (given these two transactions as a proof any miner can see it is not a double-spending attempt and accept such replacement).

What about Bob's transaction and what's the point of including him in the chain if Alice in the end sends the payment directly to Charlie? Since you got rid of the concept of channels then there shouldn't be any need of third-parties for payment routing.
coinlatte (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 16


View Profile
February 19, 2020, 01:24:24 PM
 #3

Quote
Imagine tens of thousands of such or longer chains in the mempool. Who's going to have enough memory to store all of them to ensure that none of them is dropped?
It is possible right now. You can send any transaction using 1 satoshi per byte fee and no one will stop you from spamming the network with such transactions right now. Sooner or later, mempool will reach maximum capacity and then we should have some kind of mechanism to decrease this load. If we have RBF transactions in such overloaded mempool, we can provably replace two or more transactions with one equivalent transaction without worrying about possible double spending.

Quote
What prevents Alice from spending one of the inputs of the timelocked transaction before it is included in any block?
The network will see Alice->Bob transaction earlier than Alice->Daniel transaction and reject the second one as a double-spending attempt. A node should know all replaced transactions before doing a replacement, because it is needed to prove that it is not a double-spending attempt.

Quote
What about Bob's transaction and what's the point of including him in the chain if Alice in the end sends the payment directly to Charlie?
It is needed as a proof that Alice->Charlie transaction is not a double-spending attempt, because Alice->Bob transaction was transmitted earlier.
Rath_
aka BitCryptex
Legendary
*
Offline Offline

Activity: 1876
Merit: 3132



View Profile
February 19, 2020, 05:32:25 PM
 #4

The network will see Alice->Bob transaction earlier than Alice->Daniel transaction and reject the second one as a double-spending attempt. A node should know all replaced transactions before doing a replacement, because it is needed to prove that it is not a double-spending attempt.

I don't think so. As far as I know, you can invalidate a timelock transaction if you spend one of its inputs before the timelock. It shouldn't be considered as a double-spend attempt.

It is needed as a proof that Alice->Charlie transaction is not a double-spending attempt, because Alice->Bob transaction was transmitted earlier.

I still don't get why you would need Bob as an intermediary to prove it. The only comparison that comes to my mind is a payment processor but you still didn't mention any reward for him.
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2092



View Profile
February 20, 2020, 02:34:21 PM
Merited by Wind_FURY (1), ABCbits (1)
 #5

The network will see Alice->Bob transaction earlier than Alice->Daniel transaction and reject the second one as a double-spending attempt. A node should know all replaced transactions before doing a replacement, because it is needed to prove that it is not a double-spending attempt.

I don't think so. As far as I know, you can invalidate a timelock transaction if you spend one of its inputs before the timelock. It shouldn't be considered as a double-spend attempt.

Yep. Timelocking a transaction only ensures that the timelocked transaction itself won't be accepted before the end of the timelock. You can still spend the very same coins in other transactions. That's why you can use them as part of a Dead Man's switch setup, for example.

Also, I wouldn't rely on the mempool alone to prevent double-spending. If that's all it took we wouldn't need a blockchain.

Also, mempools don't stick around forever. A timelocked transaction that's not being added to the blockchain, will get removed eventually. To make matters worse each mempool keeps transactions around for different timeframes. So the "channel state" will quicky diverge over time as mempools diverge.

Come to think of it, I'm not even sure whether a not-yet-spendable timelocked transaction is guarantueed to stick around the mempool in the first place.
konfuzius5278
Member
**
Offline Offline

Activity: 636
Merit: 11


View Profile
February 21, 2020, 03:29:53 PM
 #6

Quote
Imagine tens of thousands of such or longer chains in the mempool. Who's going to have enough memory to store all of them to ensure that none of them is dropped?
It is possible right now. You can send any transaction using 1 satoshi per byte fee and no one will stop you from spamming the network with such transactions right now. Sooner or later, mempool will reach maximum capacity and then we should have some kind of mechanism to decrease this load. If we have RBF transactions in such overloaded mempool, we can provably replace two or more transactions with one equivalent transaction without worrying about possible double spending.

Quote
What prevents Alice from spending one of the inputs of the timelocked transaction before it is included in any block?
The network will see Alice->Bob transaction earlier than Alice->Daniel transaction and reject the second one as a double-spending attempt. A node should know all replaced transactions before doing a replacement, because it is needed to prove that it is not a double-spending attempt.

Quote
What about Bob's transaction and what's the point of including him in the chain if Alice in the end sends the payment directly to Charlie?
It is needed as a proof that Alice->Charlie transaction is not a double-spending attempt, because Alice->Bob transaction was transmitted earlier.
1000 sat per kb is standart and not cheap depending on BTC price and on amound send

For the german speaking community please visit my Youtube Channel
https://www.youtube.com/channel/UCc4uWvf8yNBVE39YYlI5N9Q
garlonicon
Hero Member
*****
Offline Offline

Activity: 807
Merit: 1945


View Profile
February 21, 2020, 05:02:06 PM
 #7

Is OP trying to implement tx cut-through? It is closer to that idea than to LN...
Wind_FURY
Legendary
*
Offline Offline

Activity: 2926
Merit: 1834



View Profile
February 27, 2020, 08:32:34 AM
 #8

OP, why don't you remove all the complicated stuff, and simply accept zero-confirm transactions? "Less risk", more simple, and I believe more effective for what you want.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
Sloane Poker-Stars
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile WWW
February 27, 2020, 10:32:25 AM
 #9

Is it really necessary to be online 24/7? Undecided
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2092



View Profile
February 28, 2020, 12:02:40 AM
 #10

Is it really necessary to be online 24/7? Undecided

No, you could either :
1. Use watch tower (as mentioned by OP)
2. Only act as sender, so there's no risks of losing Bitcoin if another party broadcast earlier state of channel

What about the time window for penalty transactions though? Shouldn't the time window of one week for broadcasting a penalty transaction in case of a would-be attack be enough for someone who isn't online 24/7? Or has this been proven unreliable?

Just curious since with all the talk about Watchtowers this part of the protocol has been spoken less and less about.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!