John Dillon [ARCHIVE] on Nostr: π
Original date posted:2013-07-14 π Original message:-----BEGIN PGP SIGNED ...
π
Original date posted:2013-07-14
π Original message:-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
It's been pointed out recently how a fairly cheap attack on the Bitcoin network
would be to take advantage of the fact that we limit the number of incoming
connections, but don't require anything of those connections. This means an
attacker can simply repeatedly query the the DNS seeds for new addresses and
make enough incoming connections that those nodes can not accept further
clients. nMaxConnections defaults to 125, and beyond that there is the limit on
file descriptors, as well as possible limits by stateful firewalls. (how much
memory/cpu does an incoming connection require?) The DNS seeds themselves crawl
the network on your behalf, and let you direct the attack starting at the nodes
new SPV clients are most likely to connect too.
The cost to the attacker is minimal, 1 INV message per transaction and block,
and some gossiped peer addresses. Currently that should be on the order of 30
bytes a second. The attacker can do even better by pretending to be an SPV
client, thus reducing their incoming bandwidth consumption to nearly nothing,
yet increasing resource usage on the node.
Peter estimated you would need just 200 or so well distributed IP addresses to
make it impossible to use an SPV client. In fact as far as I can tell for
incoming connections we don't force incoming connections to be well
distributed, so the attack could be done by simply one server with enough
amount of bandwidth. Estimates of the total number of nodes out there on
mainnet are in the tens of thousands, let's say 25,000 for arguments sake. 125
connections to every one of those nodes would only cost the attacker 94MB/s of
incoming bandwidth, easily attainable by a few cheap EC2 nodes, and on EC2
incoming bandwidth is free. The SPV version of the attack would let the
attacker spend as little as they wished.
Obviously if we want to make it possible for SPV nodes to reliably connect to
the network we need to give them a way to prove they have sacrificed some
limited resource to allow nodes to distinguish legit users from attackers.
Failing that, we need to make attacks sufficiently expensive to discourage
bored script-kiddies, much the same way flooding the network with transactions
is sufficiently expensive due to fees that such attacks are impractical.
Now something to keep in mind is whatever we ask SPV nodes to sacrifice must
not be reusable. For instance proof-of-stake *doesn't* work without consensus
because an attacker can reuse the proof for multiple connections. Similarly IP
addresses don't work, requring incoming connections to be "well distributed" in
IP space isn't a bad idea, but it doesn't buy much DoS resistance. Fees paid by
confirmed transactions do work, but only if something links the transaction to
the specific connection.
We also want whatever the nodes to sacrifice to be something not much more
costly to the client than to the attacker. Bandwidth isn't reusable, but an
attacker with EC2 or a botnet has vastly lower costs for bandwidth than a user
with an Android wallet on a phone.
For a non-SPV-mode client we can easily do anti-DoS by requiring the peer to do
"useful work". As the incoming connections slots get used up, simply kick off
the incoming peers who have relayed the least fee-paying transactions and valid
blocks, keeping the peers who have relayed the most. We can continue to use the
usual, randomized, logic for outgoing peers to attempt to preserve the
randomized structure of the bitcoin network. Without an ongoing attack nodes
making new connections are unaffected, and during an attack new connections are
made somewhat easier by the increased numbers of incoming slots made available
as the attackers connections timeout.
Yes an attacker can simply relay some high-fee transactions to keep their nodes
from being kicked off, but in that case are they really an attacker? I reject
the argument that we are letting them de-randomize the structure of the network
because as I've shown they can already do that with little expenditure.
For SPV nodes again in the absense of an attack such anti-DoS code has no
effect. When an attack is launched the SPV client can simply create some
high-fee transactions with their own coins to get connection priority. SPV
nodes already have serious privacy issues, so I don't see the creation of
transactions as a big deal. Re-use is an issue, but nodes can take into account
how long it takes for another nodes to advertise the transactions when dealing
with SPV peers. Better systems can be implemented later, such as micropayment
channels and coinbase probabalistic payments, that don't result in blockchain
transactions just for the sake of anti-DoS.
A demo of the attack against would be useful. Pieter Wuille's bitcoin-seeder
code could probably be re-used as it already has the required functionality of
making large numbers of connections. In fact, simply running multiple instances
of it could do the trick.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAEBCAAGBQJR4yHgAAoJEEWCsU4mNhiPRvkH/3fl5brCe+1cBUoFtAnVHV+0
dezNeXo+nAbDg8XCkF6cmFkDBSgTj8l2iy0N1pfCq1XDXmqfM5p+CtxIBuIwwURc
KnpwNnRwoQ0JKYFonmaM0rQgOcXnRvyNq2DVL/b/fA6X3I5nignWNFDtzpvFhM+J
IjhEVbu5S25c+O8LFlJV0ujjBgnR/8gJ0xV2fvdsaisAVHly1n9QWa1FEnMz7hp9
wfXPBh8tnehKnsspyeAEq5Yc/Yyow97CdwOqPVknI0rhes0OWR8ORcJ2NkBZm/Pn
rUFFMwAme/K1f3PqW1+EpM4gG/pJvg+xU5E5KdqgnjsQLoEGWtMcxEdAeCoBuNI=
=jzfg
-----END PGP SIGNATURE-----
Published at
2023-06-07 15:04:34Event JSON
{
"id": "ce94871cb94cb5493dfceca15b196a269a372c1332b11ed7ee3441399a888e63",
"pubkey": "a0b592adfee20cad7bb28c238a9fc1fccf4511a458be8e3d96b00c914c8c3564",
"created_at": 1686150274,
"kind": 1,
"tags": [
[
"e",
"6167ee48e60c6d971e1e8913d253803b5817a594f7f001aa6edb022c2f815c17",
"",
"reply"
],
[
"p",
"a23dbf6c6cc83e14cc3df4e56cc71845f611908084cfe620e83e40c06ccdd3d0"
]
],
"content": "π
Original date posted:2013-07-14\nπ Original message:-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\nIt's been pointed out recently how a fairly cheap attack on the Bitcoin network\nwould be to take advantage of the fact that we limit the number of incoming\nconnections, but don't require anything of those connections. This means an\nattacker can simply repeatedly query the the DNS seeds for new addresses and\nmake enough incoming connections that those nodes can not accept further\nclients. nMaxConnections defaults to 125, and beyond that there is the limit on\nfile descriptors, as well as possible limits by stateful firewalls. (how much\nmemory/cpu does an incoming connection require?) The DNS seeds themselves crawl\nthe network on your behalf, and let you direct the attack starting at the nodes\nnew SPV clients are most likely to connect too.\n\nThe cost to the attacker is minimal, 1 INV message per transaction and block,\nand some gossiped peer addresses. Currently that should be on the order of 30\nbytes a second. The attacker can do even better by pretending to be an SPV\nclient, thus reducing their incoming bandwidth consumption to nearly nothing,\nyet increasing resource usage on the node.\n\nPeter estimated you would need just 200 or so well distributed IP addresses to\nmake it impossible to use an SPV client. In fact as far as I can tell for\nincoming connections we don't force incoming connections to be well\ndistributed, so the attack could be done by simply one server with enough\namount of bandwidth. Estimates of the total number of nodes out there on\nmainnet are in the tens of thousands, let's say 25,000 for arguments sake. 125\nconnections to every one of those nodes would only cost the attacker 94MB/s of\nincoming bandwidth, easily attainable by a few cheap EC2 nodes, and on EC2\nincoming bandwidth is free. The SPV version of the attack would let the\nattacker spend as little as they wished.\n\nObviously if we want to make it possible for SPV nodes to reliably connect to\nthe network we need to give them a way to prove they have sacrificed some\nlimited resource to allow nodes to distinguish legit users from attackers.\nFailing that, we need to make attacks sufficiently expensive to discourage\nbored script-kiddies, much the same way flooding the network with transactions\nis sufficiently expensive due to fees that such attacks are impractical.\n\nNow something to keep in mind is whatever we ask SPV nodes to sacrifice must\nnot be reusable. For instance proof-of-stake *doesn't* work without consensus\nbecause an attacker can reuse the proof for multiple connections. Similarly IP\naddresses don't work, requring incoming connections to be \"well distributed\" in\nIP space isn't a bad idea, but it doesn't buy much DoS resistance. Fees paid by\nconfirmed transactions do work, but only if something links the transaction to\nthe specific connection.\n\nWe also want whatever the nodes to sacrifice to be something not much more\ncostly to the client than to the attacker. Bandwidth isn't reusable, but an\nattacker with EC2 or a botnet has vastly lower costs for bandwidth than a user\nwith an Android wallet on a phone.\n\n\nFor a non-SPV-mode client we can easily do anti-DoS by requiring the peer to do\n\"useful work\". As the incoming connections slots get used up, simply kick off\nthe incoming peers who have relayed the least fee-paying transactions and valid\nblocks, keeping the peers who have relayed the most. We can continue to use the\nusual, randomized, logic for outgoing peers to attempt to preserve the\nrandomized structure of the bitcoin network. Without an ongoing attack nodes\nmaking new connections are unaffected, and during an attack new connections are\nmade somewhat easier by the increased numbers of incoming slots made available\nas the attackers connections timeout.\n\nYes an attacker can simply relay some high-fee transactions to keep their nodes\nfrom being kicked off, but in that case are they really an attacker? I reject\nthe argument that we are letting them de-randomize the structure of the network\nbecause as I've shown they can already do that with little expenditure.\n\n\nFor SPV nodes again in the absense of an attack such anti-DoS code has no\neffect. When an attack is launched the SPV client can simply create some\nhigh-fee transactions with their own coins to get connection priority. SPV\nnodes already have serious privacy issues, so I don't see the creation of\ntransactions as a big deal. Re-use is an issue, but nodes can take into account\nhow long it takes for another nodes to advertise the transactions when dealing\nwith SPV peers. Better systems can be implemented later, such as micropayment\nchannels and coinbase probabalistic payments, that don't result in blockchain\ntransactions just for the sake of anti-DoS.\n\n\nA demo of the attack against would be useful. Pieter Wuille's bitcoin-seeder\ncode could probably be re-used as it already has the required functionality of\nmaking large numbers of connections. In fact, simply running multiple instances\nof it could do the trick.\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.11 (GNU/Linux)\n\niQEcBAEBCAAGBQJR4yHgAAoJEEWCsU4mNhiPRvkH/3fl5brCe+1cBUoFtAnVHV+0\ndezNeXo+nAbDg8XCkF6cmFkDBSgTj8l2iy0N1pfCq1XDXmqfM5p+CtxIBuIwwURc\nKnpwNnRwoQ0JKYFonmaM0rQgOcXnRvyNq2DVL/b/fA6X3I5nignWNFDtzpvFhM+J\nIjhEVbu5S25c+O8LFlJV0ujjBgnR/8gJ0xV2fvdsaisAVHly1n9QWa1FEnMz7hp9\nwfXPBh8tnehKnsspyeAEq5Yc/Yyow97CdwOqPVknI0rhes0OWR8ORcJ2NkBZm/Pn\nrUFFMwAme/K1f3PqW1+EpM4gG/pJvg+xU5E5KdqgnjsQLoEGWtMcxEdAeCoBuNI=\n=jzfg\n-----END PGP SIGNATURE-----",
"sig": "70ab37f2cceec5d575283daec4e90c170f1248529398fb9f5c59aae45104df079198c34a5ab384ff5712021e46cf0c3c01f3aeffb8bba738aafc9bbd6e14b7b6"
}