cjb / GitTorrent

A decentralization of GitHub using BitTorrent and Bitcoin
MIT License
4.75k stars 264 forks source link

Usernames in the Blockchain #36

Closed super3 closed 9 years ago

super3 commented 9 years ago

http://storj.io built a nice little library for inserting data in OP_RETURN here: https://pypi.python.org/pypi/btctxstore.

Seems like its a bit of a hurdle to use the blockchain directly as a key-value store. The uninitiated would have to acquire and burn a tx fee worth of Bitcoin. Have you considered a model where you do Blockchain notarization with little to no fee?

dcousens commented 9 years ago

@super3 assuming a miner doesn't simply pick up your transaction without a fee, how do you expect to be able to put a username in the blockchain without fee's somewhere?

I guess you could maybe look at some kind of merkle root hash that gets published once every now and then and instead have donations prop that up?

Deciding what is contained in that merkle root tree though basically becomes a problem akin to finding a bitcoin block in the first place.

cjb commented 9 years ago

@super3 If that's "little" fee, then I feel like it's going to be more inconvenient for users (how do they pay that fee? are they supposed to mine?) than just spending a small amount of BTC.

super3 commented 9 years ago

@dcousens Not fee less. Its would be a merkle tree. Username data could be stored anywhere, and authenticated through this method.

So I'm thinking of the lines of a merkle root structure like @dcousens suggested. Actually wrote a service for that. Pass it a hash, it passes back a merkle proof that its in the blockchain.

If your current case 100,000 users would cost $3,000 of burned tx fees. In this case $100 or less could cover those users (to cover merkle root insertion), and the users would not have to acquire any Bitcoin. You or someone could make a donation to cover that and save the user the headache of acquiring Bitcoin.

Just trying to try to find a decentralized way to do the key value store without having users run wallet software, which will limit users significantly.

dcousens commented 9 years ago

@super3 any ideas on stopping users spamming fake usernames? Or I guess that doesn't really matter in the end?

How do we calculate the merkle tree without having some kind of authority (or relying on something like a proof-of-work mechanism)?

super3 commented 9 years ago

Don't need an authority to calculate the merkle tree. Any old server can do it. After the tree is built you don't need the generator anymore just the data.

Spam is an interesting one. I think the best you could do is put application side limits.

Shawn On Jun 2, 2015 9:00 AM, "Daniel Cousens" notifications@github.com wrote:

@super3 https://github.com/super3 any ideas on stopping users spamming fake usernames? Or I guess that doesn't really matter in the end?

How do we calculate the merkle tree without having some kind of authority (or relying on something like a proof-of-work mechanism)?

— Reply to this email directly or view it on GitHub https://github.com/cjb/GitTorrent/issues/36#issuecomment-107946110.

cjb commented 9 years ago

I think the best you could do is put application side limits.

But when you create a network / distributed system, you can't guarantee that only your application will communicate with that network; the network needs to be resilient to malicious clients. (I think charging approx $0.08 USD per username registration is a pretty good way of fixing those spam incentives.)

super3 commented 9 years ago

The application is not-needed post data insertion, if you have the metadata. I agree that it is a good anti-spam mechanism, but just as effective as an anti-user mechanism.

dcousens commented 9 years ago

just as effective as an anti-user mechanism.

Right.

Spam is an interesting one. I think the best you could do is put application side limits.

How do you reach consensus between these two application servers?

super3 commented 9 years ago

No consensus needed. Each runs independently. Once you have the merkle proof you don't need the application server.

dcousens commented 9 years ago

@super3 then how do you enforce that usernames are unique?

super3 commented 9 years ago

Hmmm, in both cases you have to have a copy of all the usernames and their records to ensure there are not duplicates. In this case its harder, because its specifically for proof of existence.

In that case something like ChainDB or Factom might be better.

dcousens commented 9 years ago

in both cases you have to have a copy of all the usernames and their records to ensure there are not duplicates

This sound suspiciously like a hash chain, with some kind of authority/consensus mechanism.

izzy commented 9 years ago

Am I the only one who thinks requiring money for registration is discriminating for those who don't have any money? You all might think, 0.08$ is not much. Sure, not much for me either, but in some poor countries that is a lot to just spend on some text.

Also, BTC is IMHO still a pretty white-n-nerdy(sorry for that euphemism) thing, and even most people I know(coming from a hack-/tech-culture background) don't even have a BTC wallet.

rom1504 commented 9 years ago

It's less expensive than a domain name, but I guess it's not 0. The thing is the way github (and bitbucket and all) provide you with your own name for free is because they are the ones paying for their server, but it still cost something. I think one way to provide the same service as github does for this part might be to have "name providers" that would give these name for free. Now that either mean these name providers would use the bitcoin-based solution to keep it decentralized and pay the 0.08$ themselves, or they would have to use a distributed but centralized thing like the DNS to have a consensus (to make name unique) and possibly reduce the costs.

cjb commented 9 years ago

@mkzero

Am I the only one who thinks requiring money for registration is discriminating for those who don't have any money?

I'm not worried about people being unable to afford $0.08. From working at One Laptop Per Child for six years, maybe this is particularly obvious to me, but to share code on a social coding site you need:

People go through great hardship and expense to get these things in the developing world -- they might be using an costly generator to get electricity that's only running for a few hours at a time and is difficult to maintain; they might have to take a long bus ride to go to somewhere with an Internet connection and pay to use it each time. I think approximately all of the people who have nonetheless found access to the above would find the idea that a one time payment of $0.08 is discriminatory laughable, and perhaps even offensive.

The point about access to BTC is a good one, though. They probably can't trade BTC locally or easily find an exchange that they can send money to. If you're concerned about that issue, I encourage you to set up some kind of scholarship to pay the $0.08 for people who can't afford to obtain BTC. I would join in too -- a fraction of the cost we spend on yearly domain name renewal for ourselves (also just "paying for text") would cover usernames for hundreds of people.

super3 commented 9 years ago

Registration is closer to $0.03 (with the current price). It would cost $240k to migrate all current Github users, and add 8 GB to the blockchain.

Here is a question. Why you do you have to use Bitcoin? Why not use another sufficiently secure blockchain, which could support way more users for less cost? Cost could be low enough to be covered by scholarships/faucets.

ralphtheninja commented 9 years ago

@super3 It's not necessary to use bitcoin. Might as well use some other blockchain. Bitcoin gives more security though.

cjb commented 9 years ago

@super3 Do you have a specific blockchain suggestion?

I like Bitcoin because I think that the cost is insignificant at the number of users in the foreseeable future, and people are more likely to have BTC that they can create OP_RETURN transactions with than for any other blockchain. Requiring users to mine non-trivial amounts of computation themselves or do currency exchange would be a dealbreaker in my opinion, I think.

super3 commented 9 years ago

@cjb Well my thought it that if you use another cryptocurrency you would just have a free service that would do the registration for you. $0.03 is not trivial at scale, but something like $0.0001 is trivial enough that someone could give you that amount free. No exchange, no mining. I would suggest Litecoin. Fees are much lower.

I think the best way to do this is simple advertising either way. The user can either pay the fee, or watch a 60 second video to cover the trivial fee. That way users would have difficulty acquiring Bitcoin or don't know what is it is could still cover the fee without exchanges or mining.

dcousens commented 9 years ago

@super3 haha, I like your idea of forcing a user to look at some advertising for a few moments to get their username.

super3 commented 9 years ago

Rather than a 9 step decentralized solution, throwback to a 90s solution and just put ads. Solves all the problems.

franko-org commented 9 years ago

Well, Franko's fee is like $0.000001 and we are willing to up the op_return to 80 with less hesitation, perhaps even higher if that would make things even easier.

rodneyrod commented 9 years ago

@cjb @super3 Have either of you thought of creating a sidechain specifically for this? It would still be able to use the hashing power of the Bitcoin network while allowing you to do your own custom protocol changes.

super3 commented 9 years ago

@rodneyrod As far as I'm concerned sidechains are magically fairy dust. Not touching it till it is mature.