Research/Bitcoin Dev Archive / lightning-dev list
Specifications of Broadcasting Layers
4 messages, Oct 16 to 20, 2015. Started by Mats Jerratsch.
Rusty Russell (2), Mats Jerratsch, Anthony Towns
Other post was quite long already and they are actually dealing with two different issues.
So currently I can think of 3 different broadcast messages, that are differently dynamic and needs different handling, so I attach them each with a new signature (which bloats a lot unfortunately). (1) Pubkey-Channel-Relationships (see other post on ML) Very static, relayed every 10 days 264 Bytes
(2) Node addresses/IP Depends on the nodes (dynamic/static IP), approx every 12h 133 Bytes (some estimate, as I want to support addresses too, not just IPs)
(3) Channel-Status (capacity, fee, ...) Highly depending on actual traffic and node usage - once an hour? 176 Bytes (estimated, depends on actual content)
I would love to combine (1) and (3) to save the 80B of an additional signature, but at the same time (1) is not worth an hourly broadcast. Furthermore, I would spare some additional bytes in (1) for some reputation system (yes, I really am into these.) These three add up to 2.5GB daily data, or 30kb/s constant load. For hard drive space it is around 330MB.
I think we can either realise it as some kind of gossip protocol (easy to implement, overhead of an efficient gossip protocol can be very low) or use some DHT approach (difficult to bootstrap, has to be designed to be highly resistant to failure/highly redundant). A new node would want to retrieve the full dataset similar to the blockchain before actually opening a channel with a new node. So we need to design a way of retrieving the full dataset for fresh nodes, probably in some load-distributed way, although 330MB isn't too much to retrieve from 1-5 nodes. (and 100k nodes is a pretty optimistic view of the network too currently, although rusty usually starts even higher...)
Mats Jerratsch
Mats Jerratsch <matsjj at gmail.com> writes:
Quoted text (7 lines)
> Other post was quite long already and they are actually dealing with > two different issues. > > > So currently I can think of 3 different broadcast messages, that are > differently dynamic and needs different handling, so I attach them > each with a new signature (which bloats a lot unfortunately).
Indeed, I think this breakdown is correct.
Quoted text (11 lines)
> (1) Pubkey-Channel-Relationships (see other post on ML) > Very static, relayed every 10 days > 264 Bytes > > (2) Node addresses/IP > Depends on the nodes (dynamic/static IP), approx every 12h > 133 Bytes (some estimate, as I want to support addresses too, not just IPs) > > (3) Channel-Status (capacity, fee, ...) > Highly depending on actual traffic and node usage - once an hour? > 176 Bytes (estimated, depends on actual content)
These estimates seem about the right ballpark to me. But once per hour may be extremely optimistic when channels approach exhaustion. That's because (1) it's logical for fees to rise significantly at that point, and (2) you want to know if capacity is sufficient for the amount you're sending.
A random beacon model has the advantage of requiring only partial topology knowledge, which makes these numbers sacle much better. However, it introduces another factor.
Quoted text (4 lines)
> I think we can either realise it as some kind of gossip protocol (easy > to implement, overhead of an efficient gossip protocol can be very > low) or use some DHT approach (difficult to bootstrap, has to be > designed to be highly resistant to failure/highly redundant).
Bram Cohen was supportive of the idea of using BitTorrent's DHT. I think that's the most sensible approach if we are going to go that route for (1 and 2).
For #3, we need our own inline protocol.
Quoted text (7 lines)
> A new node would want to retrieve the full dataset similar to the > blockchain before actually opening a channel with a new node. So we > need to design a way of retrieving the full dataset for fresh nodes, > probably in some load-distributed way, although 330MB isn't too much > to retrieve from 1-5 nodes. (and 100k nodes is a pretty optimistic > view of the network too currently, although rusty usually starts even > higher...)
Yeah, my design point has been 1M nodes. Ideally, on a cell phone :)
In the very short term, Bitcoin used IRC as the peer protocol. It has the advantage of being really easy to debug, and trivial to implement, so I'm going to aim at that while we research our more ambitious proposals...
Cheers, Rusty.
On Mon, Oct 19, 2015 at 11:18:30AM +1030, Rusty Russell wrote:
Quoted text (13 lines)
> > (1) Pubkey-Channel-Relationships (see other post on ML) > > Very static, relayed every 10 days // 264 Bytes > > (2) Node addresses/IP > > ... approx every 12h // 133 Bytes [...] > > (3) Channel-Status (capacity, fee, ...) > > ... once an hour? // 176 Bytes [...] > These estimates seem about the right ballpark to me. But once per hour > may be extremely optimistic when channels approach exhaustion. > Yeah, my design point has been 1M nodes. Ideally, on a cell phone :) > In the very short term, Bitcoin used IRC as the peer protocol. It has > the advantage of being really easy to debug, and trivial to implement, > so I'm going to aim at that while we research our more ambitious > proposals...
I'm totally a fan of being able to log the entire network dynamics too...
So doing the above over IRC means maybe doubling the byte size to encode keys/sigs into hex, and adding maybe 32B per message for IRC protocol overhead. So:
560B/channel/10 days 298B/node/12h 384B/channel/1h
Assume ~10 channels per node and converting to bytes/node/day:
560B/node/day
564B/node/day
92,160B/node/day
= 93,284B/node/day total
which is about 1.054 KiB/s per thousand nodes. If it's a single server relaying that to a thousand nodes, that's 8.2 megabit/s outgoing already. So that plan probably maxes out somewhere between 500-3000 nodes?
Quoted text (1 line)
>From what I gather bitcoin only used IRC to get IP addresses to connect
to, which were encoded in the nicks used, rather than anything being actually said. It seems like that got up to 10000 nodes [0]. Hopefully lightning's irc usage doesn't get misdetected as botnet C&C :)
[0] https://bitcointalk.org/index.php?topic=9240.0
Cheers, aj
Anthony Towns <aj at erisian.com.au> writes:
Quoted text (33 lines)
> On Mon, Oct 19, 2015 at 11:18:30AM +1030, Rusty Russell wrote: >> > (1) Pubkey-Channel-Relationships (see other post on ML) >> > Very static, relayed every 10 days // 264 Bytes >> > (2) Node addresses/IP >> > ... approx every 12h // 133 Bytes [...] >> > (3) Channel-Status (capacity, fee, ...) >> > ... once an hour? // 176 Bytes [...] >> These estimates seem about the right ballpark to me. But once per hour >> may be extremely optimistic when channels approach exhaustion. > >> Yeah, my design point has been 1M nodes. Ideally, on a cell phone :) > >> In the very short term, Bitcoin used IRC as the peer protocol. It has >> the advantage of being really easy to debug, and trivial to implement, >> so I'm going to aim at that while we research our more ambitious >> proposals... > > I'm totally a fan of being able to log the entire network dynamics too... > > So doing the above over IRC means maybe doubling the byte size to encode > keys/sigs into hex, and adding maybe 32B per message for IRC protocol > overhead. So: > > 560B/channel/10 days > 298B/node/12h > 384B/channel/1h > > Assume ~10 channels per node and converting to bytes/node/day: > > 560B/node/day > 564B/node/day > 92,160B/node/day > = 93,284B/node/day total
We'll get kicked off freenode long before that. But it allows us to master the other parts of the protocol first, up to a few hundred nodes.
Cheers, Rusty.