Michael Hendricks [ARCHIVE] on Nostr: 📅 Original date posted:2012-01-30 📝 Original message:On Sun, Jan 29, 2012 at ...
📅 Original date posted:2012-01-30
📝 Original message:On Sun, Jan 29, 2012 at 7:31 PM, Pieter Wuille <pieter.wuille at gmail.com> wrote:
> wanting to move to IPv6 support in the Satoshi bitcoin client
> somewhere in the future, the way IP addresses were managed is not
> really possible anymore. Right now, basically all addresses ever seen
> are kept - both on-disk and in-memory, and sorted on last-seen time
> with some randomization. For some people this lead to multi-megabyte
> addr.dat files that took ages (well, seconds) to load.
I think this is a great change for IPv4 too. On certain machines with
slow IO, I routinely delete the address database before starting
bitcoind to improve load times.
> After some discussion with Gregory Maxwell and others on IRC, I
> decided to write a specialized address manager based on an entirely
> different principle: only keep a limited number of addresses, keep and
> index them in-memory, and only occasionally (and asynchronously) dump
> them to disk.
I've started a couple patches with a similar design, but not produced
anything I'm happy with. That work has persuaded me that this
architecture is a valuable improvement over what we have today.
> This of course leads to a weakness: attackers may try to
> poison your entire address cache with addresses they control, in order
> to perform a Sybil attack. This is especially dangerous in the context
> of IPv6, where much more possible addresses exist.
If the Bitcoin client has multiple peer discovery methods enabled
(IRC, DNS, seed nodes, etc), it might be wise to guarantee that at
least one peer is selected via each method. This requires a Sybil
attacker to control all peer discovery methods for a successful
attack.
> To protect against this, we came up with this design: keep two tables:
> one that keeps addresses we've had actual connections with, and one
> that maintains untried/new addresses. Both are separated into several
> limited-size buckets. Each tables provides a level of protection
> against sybil attacks:
> * Addresses in the first table are placed in one of only a few
> buckets chosen based on the address range (/16 for IPv4). This way, an
> attacker cannot have tons of active nodes in the same /16 range, and
> use those to fill the table.
> * Addresses in the second table are placed in one of a few buckets
> chosen based on address range the information came from, instead of
> the address itself. This way, an attacker spamming you with tons of
> "addr" messages can only still have a limited effect.
Cool design. It seems resilient to many attacks. A Sybil attack
coming from a large botnet (which controls addresses in many ranges)
can still fill all buckets in both tables, I think. As far as I can
tell, that wasn't possible with the old design.
--
Michael
Published at
2023-06-07 03:00:30Event JSON
{
"id": "04b4fce8736f45bfc0eb6dc8049aaf0ce77735204ec4aae675088835b341bc8f",
"pubkey": "3415c93783a275488e5c6b38892170eaef07d76147cfa1af131b95577b903df7",
"created_at": 1686106830,
"kind": 1,
"tags": [
[
"e",
"c8cd18df3a4b91b5c814c19333fbefa9dd94a17bd1f2c1fb3e3d7e42339f0dfd",
"",
"root"
],
[
"e",
"cd010a34e6fb385b863a9d301dce9bd6c2cbdcd461d80bd258413965c8610d46",
"",
"reply"
],
[
"p",
"6ac6a519b554d8ff726a301e3daec0b489f443793778feccc6ea7a536f7354f1"
]
],
"content": "📅 Original date posted:2012-01-30\n📝 Original message:On Sun, Jan 29, 2012 at 7:31 PM, Pieter Wuille \u003cpieter.wuille at gmail.com\u003e wrote:\n\u003e wanting to move to IPv6 support in the Satoshi bitcoin client\n\u003e somewhere in the future, the way IP addresses were managed is not\n\u003e really possible anymore. Right now, basically all addresses ever seen\n\u003e are kept - both on-disk and in-memory, and sorted on last-seen time\n\u003e with some randomization. For some people this lead to multi-megabyte\n\u003e addr.dat files that took ages (well, seconds) to load.\n\nI think this is a great change for IPv4 too. On certain machines with\nslow IO, I routinely delete the address database before starting\nbitcoind to improve load times.\n\n\u003e After some discussion with Gregory Maxwell and others on IRC, I\n\u003e decided to write a specialized address manager based on an entirely\n\u003e different principle: only keep a limited number of addresses, keep and\n\u003e index them in-memory, and only occasionally (and asynchronously) dump\n\u003e them to disk.\n\nI've started a couple patches with a similar design, but not produced\nanything I'm happy with. That work has persuaded me that this\narchitecture is a valuable improvement over what we have today.\n\n\u003e This of course leads to a weakness: attackers may try to\n\u003e poison your entire address cache with addresses they control, in order\n\u003e to perform a Sybil attack. This is especially dangerous in the context\n\u003e of IPv6, where much more possible addresses exist.\n\nIf the Bitcoin client has multiple peer discovery methods enabled\n(IRC, DNS, seed nodes, etc), it might be wise to guarantee that at\nleast one peer is selected via each method. This requires a Sybil\nattacker to control all peer discovery methods for a successful\nattack.\n\n\u003e To protect against this, we came up with this design: keep two tables:\n\u003e one that keeps addresses we've had actual connections with, and one\n\u003e that maintains untried/new addresses. Both are separated into several\n\u003e limited-size buckets. Each tables provides a level of protection\n\u003e against sybil attacks:\n\u003e * Addresses in the first table are placed in one of only a few\n\u003e buckets chosen based on the address range (/16 for IPv4). This way, an\n\u003e attacker cannot have tons of active nodes in the same /16 range, and\n\u003e use those to fill the table.\n\u003e * Addresses in the second table are placed in one of a few buckets\n\u003e chosen based on address range the information came from, instead of\n\u003e the address itself. This way, an attacker spamming you with tons of\n\u003e \"addr\" messages can only still have a limited effect.\n\nCool design. It seems resilient to many attacks. A Sybil attack\ncoming from a large botnet (which controls addresses in many ranges)\ncan still fill all buckets in both tables, I think. As far as I can\ntell, that wasn't possible with the old design.\n\n-- \nMichael",
"sig": "15fba0a8c3613fed5f83c93f91be4ccad198d6a79eb0ecfe2c742a6dd0069fc18c964d0d33c33b61e1a27fe5b83b9165d5460d54796dd19cd78020fa968b2ce5"
}