-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add in a system to enforce namespace consensus #1
Comments
I'm thinking that the way to go is to require nodes to regularly demonstrate agreement on top-level namespace snapshots. They could do this by:
In order for nodes to show each other which namespace they think is the right one, and from there come to a consensus, they do the following:
Which name operations should require a merkle root? The only ones with enough room to fit in OP_RETURN are preorders and transfers. My instinct is that at either (a) just preorders or (b) both preorders and transfers should require the merkle root. |
Quote from @cpacia: "What would prevent someone looking to create a duplicate name from adding a merkle root of a fake namespace to the duplicate name registration. Would a light client be able to tell the difference?" |
Yeah I've been trying to think of ways to make it work. I feel like there has to be some way our there to do it, but I haven't yet worked it out. I was thinking one thing you could do is hash chain the name registrations together. Then a checkpoint could be hardcoded into a client and a server could serve up the namespace (including the bitcoin transactions) from the checkpoint forward. A lite client could verify the transactions and verify they chain back to the checkpoint. There are two problems with this approach:
|
A merkle root could work well if there is a way to prove consensus on the merkle root. |
Here's what I'm thinking: A light client starts from the first block and downloads the whole namespace until the first checkpoint it decides on. Once it reaches that checkpoint, it saves and "trusts" that checkpoint merkle root, then deletes the name operations up until that point. It repeats this process until it gets to the most recent checkpoint, and does that continuously. Not sure if this fully makes sense - have to think about it a bit more. |
OK. I don't think a blockchain-only lightweight proof is possible without an additional consensus mechanism (blockchain). In fact, I think this is why counterparty and mastercoin don't have SPV implementations ― because you can't do it. Nevertheless, here is a simple hack to fix it. You have the user include the txid in the social media proofs. This immediately solves two problems:
Problem solved :) |
Come to think of it... the user might not need to update the txid each time. Maybe only including a txid of the name registration might be enough. Then the a light client could track subsequent transactions. That could work for some use cases... such as a wallet which receives txs from the network since it will always be able to see the latest tx in the chain. But it might not work for applications that don't connect to the bitcoin network. |
Hm, this is an interesting idea. But I don't think it works because there's a circular dependency: to check if the transaction/TXID is correct, check the tweet in the supposed data --> to check if the tweet URL and by extension the data are correct, check the served transaction --> to check if the served transaction/TXID is correct, check the tweet in the supposed data ... If we can't first establish that the user's data is correct, we're not even able to establish that the twitter handle is correct in the first place. The attack:
I might be missing something here but this sounds like it doesn't work. The reason for this issue is that all the tweet verifies is that the user who owns the twitter account acknowledges that they have the name. But... it doesn't verify that a given name is owned by a given twitter account. Any twitter account can claim that it owns the name through this attack. |
Also, I don't understand why you wouldn't be able to do a lightweight proof. Let's say you have an SPV wallet for Bitcoin. You have all the headers and can know with pretty high certainty that the 6 block deep merkle root is correct. If you know that all the transactions up until that point are correct, then you can verify whether a given OP_RETURN transaction really existed in the blockchain. OK, now that we can verify whether OP_RETURN transactions actually existed in the blockchain, we need to determine whether those transactions are considered valid openname operations. To deem a given openname registration valid, we do the following:
This has the following properties:
This made sense to me. Does this work? |
The first time yo look up a name you would have to perform manual verification that the twitter handle belongs to the correct person. The client can save the information after the first time saving you from having to re-verify each subsequent look-up. What I described ends up looking a lot like how keybase works. Except here that model would only be used for a lite client with people still able to do (optional) full verification if they want to download the whole chain. Let's say I want to send you coins (wallet example):
If someone registered a fake ryanshea and the server sent me that profile... the social media accounts would not match your's and, presumably, I would catch that before sending the payment. This should provide at least the same level of security as keybase as it's a similar model. The difference being we're using bitcoin keys instead of PGP keys to sign the social media proof. |
Let me think about that for a little bit and then I'll get back to you. |
You're right, this step fixes the problem, provided that the user already knows the recipient's social media accounts. Unfortunately, my usernames on Twitter and Facebook are "ryaneshea" not "ryanshea", so you would have sent money to the wrong person 😮 |
haha yes perfect example. I think you're example using the merkle root is similar to the hash chaining I mentioned earlier. The concern I had with that is that someone could maintain a parallel chain. For example, starting at a certain point in time, for every new registration transaction an attacker could publish a duplicate registration containing a merkle root that is valid for the parallel namespace. I you end up being sent the transactions from the parallel chain, you could end up with a false picture of the namespace and I don't think your client could tell the difference. Of course, this type of attack would be public to those who can see the full chain but not to a lite client. |
A few things:
|
Just catching up on this thread. Jumping straight to
I assumed this is how this works. A SPV client boots up and gets a merkle root hash from the server, it then checks with peers to see if this is the correct tree. If the server gave you the wrong root hash, then all/most peers will need to be on the (incorrect) parallel namespace for them to say that this is the correct tree. We only need to ensure that this attack is very expensive to perform by having many public "full nodes" that are run by different organizations etc. I could be missing something here. |
I agree. Though it isn't completely trustless per se, and you would have to worry about sybil attacks in that scenario. But if you combine that with including the txid in the social media proofs, it would be extremely difficult to attack. |
Yes, doing both would be more secure. I'm just trying to think of a way around including the TXID in the tweet. Seems so unwieldy and hard on the eyes. |
I don't know if you used keybase but the process of linking a social media identity is pretty smooth. IIRC just displayed what to post and asked you to copy and past it. For example: Pretty easy and since it's really only a machine that will read it, I don't think the looks matter that much. |
Hm, interesting. Only thing is it looks fairly ugly and people are probably confused about what those characters at the end are. If people can get over that and just ignore it, then I think we're fine and it's a good measure to add in. |
Building the consensus hash over the entire namespace for each block has proven very costly, even for a small number of users (in the 10,000 range). I am currently using a consensus hash generation algorithm that simply builds a Merkle tree over the name operations discovered in the current block, and includes the consensus hash of the previous block as one of the hashes. This not only lets two Blockstore peers prove that they have processed the same operations, but also that they have processed them in the same order. This is required by virtualchain, and since since virtualchain allows there to be arbitrary side-effects to processing operations, we must allow the final state of the system to have the freedom to enforce a particular order in which operations are processed. As discussed elsewhere, non-idempotent operations (i.e. ones that conflict) that can be issued by more than one principal need to include the Merkle hash to guarantee at-most-once semantics, and resolve conflicts. This would include preordering, updating, transferring, and namepace preordering. Users shouldn't need to announce their Merkle roots; only their names (and only once the name has been registered). Once the name has been registered, Blockstore peers will have had to have processed the preorder, and will have had to agree on the same Merkle root at the time of the preorder. All of this has been implemented, so I'm going to close this issue. Please re-open if we need to revisit the consensus hash algorithm. |
Sounds good. We should open a new thread at some point around just SPV support. |
Namecoin sounds a lot easier at this point. SPV and consensus are solved problems. |
SPV support has been added in Blockstore. Namecoin has its advantages and disadvantages, we summarized lessons from our year long deployment on Namecoin here. |
To be clear, the SPV-like support has been added in the develop branch and is not fully available on the last stable release. The code is there, but we're in the process of releasing the documentation. This implements a new Merkle skip-lists based solution. The documentation will be published here, when it's ready. Stay tuned. |
This reverts commit 4f711580aa171e88d37c0b414e3a9a2b7418d0fe.
This reverts commit 4f711580aa171e88d37c0b414e3a9a2b7418d0fe.
…acks-network#1" This reverts commit 4f711580aa171e88d37c0b414e3a9a2b7418d0fe.
…endence Multisig order independence
No description provided.
The text was updated successfully, but these errors were encountered: