Rusty Russell [ARCHIVE] on Nostr: š
Original date posted:2015-09-24 š Original message: [ Pieter Wuille Cc'd for ...
š
Original date posted:2015-09-24
š Original message:
[ Pieter Wuille Cc'd for pubkey recovery, search for "recovered" ]
Mats Jerratsch <matsjj at gmail.com> writes:
>> Indeed. Random selection helps, here, but analysis will be interesting.
> How have you ended up with a number of beacons you need? 12 seems so
> low, I canāt imagine so few nodes to support all transacting for even
> 10 minutes..
As we keep the last 100 sets of beacons, the load is spread a little.
And remember that the network rebalances; too many transfers in one
direction and it becomes cheaper to send funds in the other direction.
It's unclear how bad it will be.
> And itās very difficult to estimate how much bitcoin they
> might need for that timeframe, as some people might want to transact
> only few satoshi, while others send multiple bitcoin.
True. I assume if we build it they will come. But what will the come
with?
> We can abstract
> the network towards two nodes at each end and N beacon nodes in the
> middle doing all the transacting. The two nodes at either side are
> separate networks then, which need to figure out their own routing.
Indeed, but it's efficient.
> Furthermore, I donāt really see the big advantage in this scheme. We
> still need to find a route towards these beacons, and often one might
> not be interested in the cheapest one, but would want to add more
> privacy. I think propagating the node-map is pretty efficient in
> generalā¦
It's not the node map (which is pretty static; we've even discussed
making the on-chain anchor transactions be the map), it's the continuous
fee updates.
>> Short term I'm thinking we'll have an IRC channel (a-la early bitcoin)
>> and everyone will advertise their channels there. This is design for
>> the next, more ambitious phase.
>
> Hm I think this would be a wasted effort. While there are probably good libraries to do the job out there, it would still need some implementation. As soon as we can solve the node discovery (and if we want to go with a central server, we might just as well hard-code some reliable nodes into the code for now), we can communicate over the network..
As you note below, we can use IRC for the node discovery too. If we
just have an IRC channel where you send all your routes, we get both.
That lets us design something real, while we work on getting the rest
stable.
>>> Furthermore, we can also include
>>> some byte for a reputation / web-of-trust system. It is completely
>>> optional, if you are able to figure out how to route the payment
>>> across your nodes you are not forced to use this system, and I don't
>>> think it will have severe privacy problems.
>>
>> I think reputation systems will become an overlay, if the basic system
>> proves vulnerable. It's nicer if we don't have to though, as reputation
>> is both hard to encode in normal behaviour, and deeply centralizing.
>
> Yea centralisation is an issue with reputation, we might want to have it rather limited. Have it some way, such that there isnāt much difference between a big node that has been around for long and a relatively new node, as long as both are
> (1) low latency
> (2) highly available
> (3) honest.
(1) can be measured, (2) can be intuited over time, but I have no idea
how to measure (3) :(
>>> Is there any plan how we handle connections currently? I am thinking
>>> about sending the current IP address with this update, such that nodes
>>> can connect to each other after one broke down again, and it would
>>> further support dynamic IPs as well. Could be possible to extend this
>>> to hidden service notation, although this would need some more bytes
>>> to store.
>>
>> So, I'm assuming the basic network comms is organized along channel
>> lines; you have to communicate to the other end of the channel anyway,
>> so that makes sense.
>>
>> This doesn't solve "how do I connect to the network" or "how do I start
>> a channel with this particular node", though. For that, I've floated
>> the idea of reusing the bittorrent DHT, which has extensions to allow
>> just this.
>
> Yea exactly, we can squeeze these information in there. The packages
> are very small. If we end up in a situation where they impede the
> payment transactions, we might want to have some priority mechanism..
Yes, and it's proven and robust in practice. It's also possible
that by adding nodes to the BT DHT we help robustness for everyone.
> The āhow to connect to the networkā can be solved with basic peer
> discovery schemes, like IRC or stable-nodes. Having received the
> topology of the mesh, you can decide which nodes you want to create a
> channel with (maybe we should add a flag somewhere, whether this node
> wants to open a channel with strangers and under which conditions). He
> can directly connect to that node and open a channel with him, or am I
> missing something?
To start, I was thinking you establish channels with 5 random nodes.
Later, we'll probably want something more sophisticated, like 2 nearby
nodes (low ping time), and 3 random nodes. Close nodes make sense
because payments also cluster along geographic lines. Random nodes make
sense for network robustness. Over time, you might open a channel to a
node you end up using regularly; there's heaps of fun heuritics to be
developed here!
I assumed that advertising an address would be optional; so if you don't
want incoming connections, don't advertise.
>> You can squeze some more bytes out of you want:
>> 1) Signature should be 64 bytes (never DER encode).
>> 2) Pubkey can be hashed bitcoin-address style, and recovered from sig.
>
> You can recover the pubkey from the hash and the sig? Why are we putting the pubkey in the scriptSig then? ;)
Because crypto is hard :(
TBH I only learned a few months ago that you can do this.
It helps if you have the (two-bit) recovery id, but you can brute force
it AFAICT. You then check if the pubkey matches the hash you're given.
>> If we're using protobufs, they're extensible, so you can add reputation
>> later if we need it.
>>
>> You also want two signatures, I think: one from each side. Though it
>> makes sense to have a separate teardown message which only needs one
>> sig.
>
> Yea was thinking about this as well, I thought as both nodes will propagate their own message, other nodes can puzzle it out, whether the channel has been confirmed by both parties. It saves one signature too..
Or, in other words, they propagate almost twice as much data :)
>> Unclear what reputation means, here?
>
> I was thinking about storing reputation for some time for all
> nodes. Iām not sure this is a good idea anymore, as it may lead to
> some amount of centralization.. It would be beneficial in this case to
> have the reputation data along with the signature only, to be
> efficient. That way you can always recover the reputation data of all
> nodes of the network for a new node, as you can send along all
> signatures..
You need to flesh out how reputation is built and destroyed. Does
someone with sufficient reputation complain about someone else?
Every time I tried to build a reputation system my head hurt :(
>> BTW I've not been separating nodes and clients in my head-design. Of
>> course, some nodes might not ever generate payments, and some nodes
>> might never route others' payments, but it increases privacy vastly if
>> they *can*, so I'm trying to think about them that way.
>
> For me it is more a connection issue. Nodes should have a 99+% uptime
> and allow for direct incoming connections. Still have to figure it
> out, but of course as a node provider you can always issue a payment
> directly (I think for any outsider, there is no difference between the
> node issuing the payment or some client connected to that node)
Yes, and eventually we end up bridging to other networks, so you really
can't tell.
A weird property is that it's only mildly bad to be unreachable (stuff
just bounced back for re-routing), as long as you don't go unreachable
with HTLCs outstanding. The latter will cause people to drop channels
to you.
>> What do you think about the idea of using the anchor transactions in the
>> blockchain as a map of the network? You could use an OP_RETURN to stash
>> two pubkeysx, that is the two node IDs.
>
> Hm isnāt this difficult to prove? Anyone could have put those pubkeys
> in there, so unless we further put a signature in there, this
> information holds little value I think..
Yeah, good point! We can't fit key+sig in 80 bytes, either. Need to do
something less dumb if we go that route...
> I like the idea in general,
> as it would make fake-nodes more difficult, but I think it is
> difficult to implement in the bitcoin blockchain.
I think I'm uncomfortable because I've tried to err on the side of
releasing as little info as possible.
> Furthermore, how do
> you plan to have the scriptPubKey for the anchor tx then? Ultimately
> it is still P2SH, so no one is really able to recover any data from
> it..
We could actually make this one non-P2SH, since multisig is standard.
That would imply that the address there is the node id.
> As a plus, I am currently working on some simulation project for
> lightning. A lot of the metrics are very difficult to estimate (let
> alone calculate), and often we want to depend on random selection. We
> will be able to deduct a lot of properties from it, and be able to
> determine, whether we need something like the reputation system at
> all, and how many dishonest nodes it takes for some attacks, and how
> efficient routing is, all the good stuff...
Great! BTW my mental goalpost is 1M nodes. More than that is still
interesting, but probably only realistic once we have more/real data.
> Cheers,
> Mats
>
> PS.: This was the last time I opened a new thread incidentally -.- Just disabled the digest option⦠;) Sorry for the inconvenience...
Heh, that's fine. You get a free pass when you've got such
information-dense mails :)
Thanks!
Rusty.
Published at
2023-06-09 12:44:34Event JSON
{
"id": "0385adefb18401e4f18315947bbfb7cfad1567996713f8b0268005913cb48584",
"pubkey": "13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425",
"created_at": 1686314674,
"kind": 1,
"tags": [
[
"e",
"d508e26ae44d949f7c534399c4b1e4f82df043bc5ea4ea4a1d4d81571bfaec45",
"",
"root"
],
[
"e",
"06d140a0e72ed214d00a314d38c097df90de5db269252821a4c33e40baeae178",
"",
"reply"
],
[
"p",
"b8a27d18150405cdfcd44c0dd8db860f5270312300248389bf57ce555c784528"
]
],
"content": "š
Original date posted:2015-09-24\nš Original message:\n[ Pieter Wuille Cc'd for pubkey recovery, search for \"recovered\" ]\n\nMats Jerratsch \u003cmatsjj at gmail.com\u003e writes:\n\u003e\u003e Indeed. Random selection helps, here, but analysis will be interesting.\n\n\u003e How have you ended up with a number of beacons you need? 12 seems so\n\u003e low, I canāt imagine so few nodes to support all transacting for even\n\u003e 10 minutes..\n\nAs we keep the last 100 sets of beacons, the load is spread a little.\nAnd remember that the network rebalances; too many transfers in one\ndirection and it becomes cheaper to send funds in the other direction.\nIt's unclear how bad it will be.\n\n\u003e And itās very difficult to estimate how much bitcoin they\n\u003e might need for that timeframe, as some people might want to transact\n\u003e only few satoshi, while others send multiple bitcoin.\n\nTrue. I assume if we build it they will come. But what will the come\nwith?\n\n\u003e We can abstract\n\u003e the network towards two nodes at each end and N beacon nodes in the\n\u003e middle doing all the transacting. The two nodes at either side are\n\u003e separate networks then, which need to figure out their own routing.\n\nIndeed, but it's efficient. \n\n\u003e Furthermore, I donāt really see the big advantage in this scheme. We\n\u003e still need to find a route towards these beacons, and often one might\n\u003e not be interested in the cheapest one, but would want to add more\n\u003e privacy. I think propagating the node-map is pretty efficient in\n\u003e generalā¦\n\nIt's not the node map (which is pretty static; we've even discussed\nmaking the on-chain anchor transactions be the map), it's the continuous\nfee updates.\n\n\u003e\u003e Short term I'm thinking we'll have an IRC channel (a-la early bitcoin)\n\u003e\u003e and everyone will advertise their channels there. This is design for\n\u003e\u003e the next, more ambitious phase.\n\u003e\n\u003e Hm I think this would be a wasted effort. While there are probably good libraries to do the job out there, it would still need some implementation. As soon as we can solve the node discovery (and if we want to go with a central server, we might just as well hard-code some reliable nodes into the code for now), we can communicate over the network..\n\nAs you note below, we can use IRC for the node discovery too. If we\njust have an IRC channel where you send all your routes, we get both.\n\nThat lets us design something real, while we work on getting the rest\nstable.\n\n\u003e\u003e\u003e Furthermore, we can also include\n\u003e\u003e\u003e some byte for a reputation / web-of-trust system. It is completely\n\u003e\u003e\u003e optional, if you are able to figure out how to route the payment\n\u003e\u003e\u003e across your nodes you are not forced to use this system, and I don't\n\u003e\u003e\u003e think it will have severe privacy problems.\n\u003e\u003e \n\u003e\u003e I think reputation systems will become an overlay, if the basic system\n\u003e\u003e proves vulnerable. It's nicer if we don't have to though, as reputation\n\u003e\u003e is both hard to encode in normal behaviour, and deeply centralizing.\n\u003e\n\u003e Yea centralisation is an issue with reputation, we might want to have it rather limited. Have it some way, such that there isnāt much difference between a big node that has been around for long and a relatively new node, as long as both are \n\u003e (1) low latency\n\u003e (2) highly available\n\u003e (3) honest.\n\n(1) can be measured, (2) can be intuited over time, but I have no idea\nhow to measure (3) :(\n\n\u003e\u003e\u003e Is there any plan how we handle connections currently? I am thinking\n\u003e\u003e\u003e about sending the current IP address with this update, such that nodes\n\u003e\u003e\u003e can connect to each other after one broke down again, and it would\n\u003e\u003e\u003e further support dynamic IPs as well. Could be possible to extend this\n\u003e\u003e\u003e to hidden service notation, although this would need some more bytes\n\u003e\u003e\u003e to store.\n\u003e\u003e \n\u003e\u003e So, I'm assuming the basic network comms is organized along channel\n\u003e\u003e lines; you have to communicate to the other end of the channel anyway,\n\u003e\u003e so that makes sense.\n\u003e\u003e \n\u003e\u003e This doesn't solve \"how do I connect to the network\" or \"how do I start\n\u003e\u003e a channel with this particular node\", though. For that, I've floated\n\u003e\u003e the idea of reusing the bittorrent DHT, which has extensions to allow\n\u003e\u003e just this.\n\u003e\n\u003e Yea exactly, we can squeeze these information in there. The packages\n\u003e are very small. If we end up in a situation where they impede the\n\u003e payment transactions, we might want to have some priority mechanism..\n\nYes, and it's proven and robust in practice. It's also possible\nthat by adding nodes to the BT DHT we help robustness for everyone.\n\n\u003e The āhow to connect to the networkā can be solved with basic peer\n\u003e discovery schemes, like IRC or stable-nodes. Having received the\n\u003e topology of the mesh, you can decide which nodes you want to create a\n\u003e channel with (maybe we should add a flag somewhere, whether this node\n\u003e wants to open a channel with strangers and under which conditions). He\n\u003e can directly connect to that node and open a channel with him, or am I\n\u003e missing something?\n\nTo start, I was thinking you establish channels with 5 random nodes.\nLater, we'll probably want something more sophisticated, like 2 nearby\nnodes (low ping time), and 3 random nodes. Close nodes make sense\nbecause payments also cluster along geographic lines. Random nodes make\nsense for network robustness. Over time, you might open a channel to a\nnode you end up using regularly; there's heaps of fun heuritics to be\ndeveloped here!\n\nI assumed that advertising an address would be optional; so if you don't\nwant incoming connections, don't advertise.\n\n\u003e\u003e You can squeze some more bytes out of you want:\n\u003e\u003e 1) Signature should be 64 bytes (never DER encode).\n\u003e\u003e 2) Pubkey can be hashed bitcoin-address style, and recovered from sig.\n\u003e\n\u003e You can recover the pubkey from the hash and the sig? Why are we putting the pubkey in the scriptSig then? ;)\n\nBecause crypto is hard :(\n\nTBH I only learned a few months ago that you can do this.\n\nIt helps if you have the (two-bit) recovery id, but you can brute force\nit AFAICT. You then check if the pubkey matches the hash you're given.\n\n\u003e\u003e If we're using protobufs, they're extensible, so you can add reputation\n\u003e\u003e later if we need it.\n\u003e\u003e \n\u003e\u003e You also want two signatures, I think: one from each side. Though it\n\u003e\u003e makes sense to have a separate teardown message which only needs one\n\u003e\u003e sig.\n\u003e\n\u003e Yea was thinking about this as well, I thought as both nodes will propagate their own message, other nodes can puzzle it out, whether the channel has been confirmed by both parties. It saves one signature too.. \n\nOr, in other words, they propagate almost twice as much data :)\n\n\u003e\u003e Unclear what reputation means, here?\n\u003e\n\u003e I was thinking about storing reputation for some time for all\n\u003e nodes. Iām not sure this is a good idea anymore, as it may lead to\n\u003e some amount of centralization.. It would be beneficial in this case to\n\u003e have the reputation data along with the signature only, to be\n\u003e efficient. That way you can always recover the reputation data of all\n\u003e nodes of the network for a new node, as you can send along all\n\u003e signatures..\n\nYou need to flesh out how reputation is built and destroyed. Does\nsomeone with sufficient reputation complain about someone else?\n\nEvery time I tried to build a reputation system my head hurt :(\n\n\u003e\u003e BTW I've not been separating nodes and clients in my head-design. Of\n\u003e\u003e course, some nodes might not ever generate payments, and some nodes\n\u003e\u003e might never route others' payments, but it increases privacy vastly if\n\u003e\u003e they *can*, so I'm trying to think about them that way.\n\u003e\n\u003e For me it is more a connection issue. Nodes should have a 99+% uptime\n\u003e and allow for direct incoming connections. Still have to figure it\n\u003e out, but of course as a node provider you can always issue a payment\n\u003e directly (I think for any outsider, there is no difference between the\n\u003e node issuing the payment or some client connected to that node)\n\nYes, and eventually we end up bridging to other networks, so you really\ncan't tell.\n\nA weird property is that it's only mildly bad to be unreachable (stuff\njust bounced back for re-routing), as long as you don't go unreachable\nwith HTLCs outstanding. The latter will cause people to drop channels\nto you.\n\n\u003e\u003e What do you think about the idea of using the anchor transactions in the\n\u003e\u003e blockchain as a map of the network? You could use an OP_RETURN to stash\n\u003e\u003e two pubkeysx, that is the two node IDs.\n\u003e\n\u003e Hm isnāt this difficult to prove? Anyone could have put those pubkeys\n\u003e in there, so unless we further put a signature in there, this\n\u003e information holds little value I think..\n\nYeah, good point! We can't fit key+sig in 80 bytes, either. Need to do\nsomething less dumb if we go that route...\n\n\u003e I like the idea in general,\n\u003e as it would make fake-nodes more difficult, but I think it is\n\u003e difficult to implement in the bitcoin blockchain.\n\nI think I'm uncomfortable because I've tried to err on the side of\nreleasing as little info as possible.\n\n\u003e Furthermore, how do\n\u003e you plan to have the scriptPubKey for the anchor tx then? Ultimately\n\u003e it is still P2SH, so no one is really able to recover any data from\n\u003e it..\n\nWe could actually make this one non-P2SH, since multisig is standard.\nThat would imply that the address there is the node id.\n\n\u003e As a plus, I am currently working on some simulation project for\n\u003e lightning. A lot of the metrics are very difficult to estimate (let\n\u003e alone calculate), and often we want to depend on random selection. We\n\u003e will be able to deduct a lot of properties from it, and be able to\n\u003e determine, whether we need something like the reputation system at\n\u003e all, and how many dishonest nodes it takes for some attacks, and how\n\u003e efficient routing is, all the good stuff...\n\nGreat! BTW my mental goalpost is 1M nodes. More than that is still\ninteresting, but probably only realistic once we have more/real data.\n\n\u003e Cheers,\n\u003e Mats\n\u003e\n\u003e PS.: This was the last time I opened a new thread incidentally -.- Just disabled the digest option⦠;) Sorry for the inconvenience...\n\nHeh, that's fine. You get a free pass when you've got such\ninformation-dense mails :)\n\nThanks!\nRusty.",
"sig": "7dedde29d6f534541a81bcd6c49ef1f442f35136b63325a1fc82d61926d29bee7231ff1ba186243671f38b8c6e44c54390df2e3c30df3becdc61f6f9a15c4870"
}