Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Google announces bitcoinj: a bitcoin implementation in Java (code.google.com)
117 points by nas on March 7, 2011 | hide | past | favorite | 44 comments


This comment is dead for some reason, but useful:

1 point by nas 52 minutes ago | link [dead]

From the bitcoin.org forum: "Google is pleased to announce the release of BitCoinJ, an implementation of the BitCoin system in Java. You can get it here under the Apache 2 license." I suspect this is maybe not Google the corporation but a Google employee using their 20% time. Edit: I could be wrong, according to the IRC chat, it is an "official" project: http://www.reddit.com/r/Bitcoin/comments/fyzhk/google_is_ple...


Chris DiBona replied below that it is just a 20% project.


You can tell because it doesn't have the Google label.


The only thing that makes this seem offical is that the email address of the coder is "hearn@google.com", which AFAIK is only available to google employees.


The author explains in the bitcoin forum that the library is his 20% project.

from http://www.bitcoin.org/smf/index.php?topic=4236.0 "Google staff have the ability to spend ~20% of their time on projects that interest them ... standard process for open sourcing our code ... checked by our lawyers for things like trademark/export compliance... This is why the code has our copyright at the top.

This is not "official" in that it does not reflect some vast corporate master plan, we are not about to start accepting BitCoins for AdWords, we have not just dropped 200GHash/sec into the network and we are not going to fork the block chain (to mention just a few of the theories I've seen floating around)."


Is this an official Google project? Would be interesting to see Google Market support Bitcoin...


Nope, it's a 20% project of on of our engineers. Google has no intention that I know of going further.


Around 300 mhash/sec coming to our bitcoin mining pool are from several Google's ips.

Is it another 20% project? :)


A single ATI Radeon HD 5970 can do 600 mhash/sec. See https://en.bitcoin.it/wiki/Mining_hardware_comparison#AMD


He meant Ghash/sec. That's quite a few ATI cards. ;-)


Dunno how much this means, but the Java package namespace is within com.google. http://bitcoinj.googlecode.com/svn/trunk/docs/index.html


It looks like it might be someone's 20% project.


I highly doubt this is official.


A good discussion about Bitcoin from about a month ago: http://news.ycombinator.com/item?id=2200705


seeing this packaged into a embeddable library really makes me want to do something like flattr but just using bitcoins (and not taking a cut. this would be just for fun)

bitcoins are essentially free to transfer in any amount, so you could easily share 100% of what users are willing to contribute.

Also, this would allow the service to instantly transfer a percentage of whatever a user has set aside, or even queue transfers up until coins are available.

I really want to look into this now.


You mean something just like: http://www.YouTipIt.org ? (add a tip badge on your site and accept bitcoins)

Here's a site with a YouTipIt badge: http://www.BitcoinMiner.com

YouTipIt's fee is 0.01 BTC per tip, subtracted from the tip amount.

-----

There's also a Hacker News / Reddit / Digg type of site, where you pay bitcoins to post, vote, and reply. But then you earn from anyone who subsequently votes or replies to your contributions. It's live now: http://www.witcoin.com


Witcoin is fascinating; thanks for the link. But it seems like it could make trolls very rich.


Only if they are very good trolls :)


> seeing this packaged into a embeddable library really makes me want to do something like flattr but just using bitcoins (and not taking a cut. this would be just for fun)

Please, please do. I love the flattr idea, but it would need a lot more donors to have a significant effect. And it turns out most donors aren't ready to use a service that takes 10% of their donations.

The same idea for free or almost, which could be implemented with bitcoins to avoid transaction fees, could be a huge success. And I'd donate to its creator :)


I would like to subscribe to the verbose version of your newsletter :) That sounds very interesting.


A way to use BitCoin on AppEngine would be useful.


Here are two Bitcoin sites that run on App Engine (though the Bitcoin wallet is on an EC2 instance):

https://www.clearcoin.com/

http://freebitcoins.appspot.com/

- http://python.witcoin.com/p/152/Python-and-Bitcoin


I knew there are bitcoin app engine projects. It just would be nice to host everything including the wallet on AppEngine. Since money is involved, would be nice to not have too much administrator responsibility.


The mechanism in the BitCoin network for making sure that not too many bitcoins are being made is to adapt the difficulty of making a new BitCoin according to the average processing power available to the entire network over the last 72 (?) hours. If Amazon or Google just dumped tens of thousands of nodes into the BitCoin network for a couple days, they could conceivably make more BitCoins than are "supposed" to be made, and own most of the currency for themselves. The artificial scarcity might drive up the price, or everyone else might just get bored and leave.


Wrong. It's every 2100 blocks. The difficulty adjust so that the rate of bitcoin generation is always 300 bitcoin per hours. Also, it's not possible to generate more than 21 million bitcoin.

Last time I heard, every 27 days, the hashrate of the network double, so it become more expensive for big dudes to own more than half of the hashing power of the network. Remember, the bulk of the computation machinery are ATI 5870 GPU farms, which are better than almost all the GPU out there for hashing. Amazon doesn't have these GPUs, and I don't know if Google possess a GPU farm.

Read the FAQ at https://en.bitcoin.it/wiki/FAQ


It's funny that people are adopting BitCoin without any compelling evidence that it is safe. All alarm bells should go off when you hear "security without trust". I'm sure that if BitCoin will be taken seriously, Bruce Scheier will be happy to cause the first decentralized currency crash.

There are many things you can do to rip apart a peer-to-peer network. You start by generating a few million identities. Next, you start manipulating the peer sampling mechanisms to surround nodes with evil peers and create groups of evil peers ready to acknowledge transactions. Finally, you can convince surrounded nodes of pretty much anything (e.g., that the network is far smaller and younger than it actually is) unless they consult a trusted authority claiming otherwise.

Of course, if you had a trusted authority you wouldn't have to go through all this trouble and you could just let it sign a bunch of coins or even handle the full transactions. It would be just like every other currency, and now you know why.

By the way, anyone can rent a cheap, on-demand GPU farm from Amazon: http://aws.amazon.com/ec2/hpc-applications/


It's funny that people are adopting BitCoin without any compelling evidence that it is safe. All alarm bells should go off when you hear "security without trust". I'm sure that if BitCoin will be taken seriously, Bruce Scheier will be happy to cause the first decentralized currency crash. There are many things you can do to rip apart a peer-to-peer network. You start by generating a few million identities. Next, you start manipulating the peer sampling mechanisms to surround nodes with evil peers and create groups of evil peers ready to acknowledge transactions. Finally, you can convince surrounded nodes of pretty much anything (e.g., that the network is far smaller and younger than it actually is) unless they consult a trusted authority claiming otherwise.

The longest blockchain are accepted as the most authoritative. Unless the evil peers are able to generate enough mining power, they can't discard transactions.

While evil peers can refuse to transmit or rely transaction, it only took a single peer to connect to the authentic network.

Also notes that the bitcoin network do not use any form of identities other than IP addresses themselves. So the attackers would need access to million of IP addresses to create that many evil nodes.

Perhaps with an attack, it will be possible to disrupt transactions in the bitcoin network, but it will not be possible to steal money or make money disappear. However, it would need to be very carefully planned and executed.

By the way, anyone can rent a cheap, on-demand GPU farm from Amazon: http://aws.amazon.com/ec2/hpc-applications/

http://www.bitcoin.org/smf/index.php?topic=1795.0

You seem to not have done the math yet.


The longest blockchain are accepted as the most authoritative.

Why would the nodes be aware of the longest block chain?

Unless the evil peers are able to generate enough mining power, they can't discard transactions.

Lets, for the sake of the argument, assume they don't. What makes you so sure I can't make others do the work for me?

While evil peers can refuse to transmit or rely transaction, it only took a single peer to connect to the authentic network.

How do you know it's authentic?

Also notes that the bitcoin network do not use any form of identities other than IP addresses themselves. So the attackers would need access to million of IP addresses to create that many evil nodes.

or 0.0000000000000000000000000000001% of the IPv6 pool ;-)

but actually, BitCount identities are public/private key pairs and you can have them in an infinite amount: http://en.wikipedia.org/wiki/Bitcoin#Addresses

Also: http://www.bitcoin.org/wiki/doku.php?id=ip_address

You seem to not have done the math yet.

You seem to assume the value of BTC is not going to increase despite them becoming increasingly hard to generate. Are you saying you expect bitcoin to fail?


Why would the nodes be aware of the longest block chain?

You would need to control 100% of the network view of the node to fool the node.

Lets, for the sake of the argument, assume they don't. What makes you so sure I can't make others do the work for me?

You would need to gain access to tons of PCs to take over the network. Not to mention it get harder when the total hashing rate of the network continue to increase. Even then, it will be very noticeable that somebody is attempting to doublespend.

but actually, BitCount identities are public/private key pairs and you can have them in an infinite amount.

That have nothing to do with P2P identities.

How do you know it's authentic?

The longest blockchain is considered the most authentic.

Also: http://www.bitcoin.org/wiki/doku.php?id=ip_address

IP transactions are depreciated and disabled by default. They are also known to be insecure.

You seem to assume the value of BTC is not going to increase despite them becoming increasingly hard to generate. Are you saying you expect bitcoin to fail?

I acknowledge that Amazon could be profitable, but they are certainly worser option compared to buying ATI 5790s.


You seem to assume the value of BTC is not going to increase despite them becoming increasingly hard to generate.

/economics fail

Difficulty to generate bitcoins does not cause them to increase in value. Their increase in value drives up the investment in mining, which then drives up the difficulty.


I updated that forum post with new numbers showing that at the current difficulty it might cost over $700 to generate a single block, and at the estimated difficulty which will happen tomorrow, it will cost over $1000 to generate a single block.

Generating a block currently gives you 50 bitcoins that are worth about $45 at the current market price.


I guess you mean for CPU mining? Mining with a GPU is definitely profitable.

That's why the difficulty keeps increasing; mining is so lucrative that an ever increasing number of people are getting on board, which drives up the difficulty.


No, I was referring to mining on Amazon's GPU systems.


There is extensive discussion on the bitcoin forums about these attack vectors and others.

One thing I find interesting is how the p2p trust setup starts to model "reality" or psychology. The question "How do I know whats real?" has an overlap with the million-evil-peer scenario you described. If ten of your friends told you a bus was on fire in the next neighborhood, would you believe them? My point is the attack you're describing is so general that its beyond trying to fix with a particular p2p setup and we have to go with whats 'good enough'.

Thats the basis of the bitcoin system and probably many others. It asks "is this transaction real?" and its real if "most people say its real".

Whats even more interesting is that hard crypto enforces a very small number of properties of the bitcoin system. The hash rate difficulty control, the number of coins awarded for "mining", and others aspects are controlled by, as you have described, the majority installed base. Like a game of Othello or Reversi, majority rules.


> All alarm bells should go off when you hear "security without trust".

I agree and disagree. Your position assumes that national governments and banks are fully trustable. We just had a thread here yesterday about how it seems rather fishy that it takes banks several days to carry out a distributed transaction that increments/decrements two long integers across the Internet. Add in the various shenanigans US Congress and the Federal Reserve do with the federal budget and money supply, and the likely reality of wide-scale manipulation conspiracies by Wall Street. This and other issues does not add up to a picture of a perfectly trustable system. And it's the baseline against which you have to evaluate Bitcoin.

That said, your hypothetical attack scenarios are legitimate things to consider. I'm not qualified to speak about whether they are feasible or if counter-measures have already been designed into the system yet, or whether these are fatal flaws. I do think it's useful to consider new ways of dealing with financial transactions if there are opportunities to leverage new technology that lets us keep the baby while getting rid of the bathwater.


Actually, the difficulty adjustment is 2016 blocks, not 2100 blocks. Sorry for the inaccuracy.

The GPU farms are actually ATI 5970, not 5870.


What about Pixar? Couldn't they turn their renderfarm towards bitcoins and crowd everyone else out?


The stats I saw on Pixar's render farm is 3000 AMD processors. Without knowing the exact CPU, let's pick a reasonable estimate that each cranks out about 5 mhps. That's a total hashspeed of 15 ghps. The current bitcoin network is pumping out over 500 ghps. No one would even notice if Pixar put the whole farm on bitcoin mining.


I used to be fascinated by this type of peer-to-peer system and spent a lot of time studying and designing them. Unfortunately, there is pretty much always a way to overthrow/overtake them with lies and large groups unless there is a central authority. Looking at BitCoin's somewhat arcane approach and apparent lack of verification of its methods, I highly doubt that it would be different from all the others.


"I used to be fascinated by this type of centralized system and spent a lot of time studying and designing them. Unfortunately, there is pretty much always a way to overthrow/overtake them with lies and large groups as long as there is a central authority. Looking at the government's somewhat arcane approach and apparent lack of verification of its methods, I highly doubt that it would be different from all the others."


You don't have to outrun the bear, you just have to outrun the other guy. (and the other guy is a billion-strong bureaucracy.)


Isn't the full block chain required? When your by client connects to peers, I thought it needed the full chain for verification?


I'm not sure but a Merkle tree is used so that the amount of data downloaded by a pure client is much smaller than what a full bitcoin node needs to download. This Java implementation would be well suited to an Android phone.


The Google connection is interesting. Because Bitcoin's greatest weakness is that the integrity of the system can be subverted by a malevolent participant who has enough computing nodes to make up the majority of computing power. Not that I'm saying Google would do this. Or that Google couldn't do this if they just used the main C++ implementation. It was just an interesting coincidence because when one thinks of entities that might have massive computing power at their disposal, things like various major national governments (the US NSA, China, etc.), or companies like Google and Amazon, come to mind.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: