neslekkim

Bitcoin?

Recommended Posts

With the recent news in media about bitcoins, it seems like an cool project to try on the Papilio Pro

 

I have found lots of projects on github etc, but it looks like most of them for xilinx targets the lx150, but when looking at the code (I have not done anything else than just reading some of the code yet) it doesnt look like it requires an lx150

 

there are boards like the ztex, with 4 pieces lx150, that have an opensource implementation, but that one also have an cypress mcu for controlling and communication with the computer, but I guess that the free webpack for xilinx cannot synthesize for the lx150?

 

Where I'm kinda stuck in my thoughtprocess now, about this, is that the sources for fpga looks like they are implementing the hashing algoritms etc, but there are no easy way of communicating with the world, for hashexcange and such.

 

Have anyone tried this?

Share this post


Link to post
Share on other sites

I did a real quick try at getting bitcoin to run on the Papilio One over a year ago. I only spent a couple hours looking at the source code, changing clocks etc. It was synthesizing, but it was running for three days straight before I decided to kill it. The person who asked me give it a try said that people were saying it sometimes took a week or more to synthesize for the LX150.

 

This all sounds weird but that is why I never really got back to it. Maybe its possible to do, but the quick try I did was frustrating enough that I haven't tried again.

 

Jack

Share this post


Link to post
Share on other sites

well, they are able to get around 230mhash/s on one lx150, and 860 on the ztex boards with four lx150, so something must be right.

But I understand that there are enought cells on the spartans, but there are to little wires to make it efficient enough.

 

And that leads to the next point, for creating asics, one can use fpga, but, since the spartan6 is obviously to small, what kind of fpga would be usable to create design and verification for an efficient asic design?, or is this not the way to go?

Share this post


Link to post
Share on other sites

I had a look at this for SHA-1... Bitcoin uses SHA-256, so without looking in detail...

 

* To work best you would like to generate one hash per cycle.

 

* To work fast you need to unroll & pipeline any iterative process (aka rounds) and register the result of each round.

 

* SHA-256 uses 64 rounds, each of 256 bits, so if you were to pipeline each at each round (to minimise levels of logic nd boost speed) you need 16,384 bits of state.

 

* You will also need something to hold the current block (256 bits), and distribute bits to the rounds. This will need around around 256 shift registers, with an average length of around 32 bits = 8192 bits of state there.

 

In summary, to process one 256 bit block of a SHA-256 every clock cycle, at the highest clock cycle, on a device with 8 flipflops per CLB would require a around 16386/8 = 2048 slices for the hashing, and another 8192/32 = 256 or so for distributing the data blocks to the rounds. = 2,304 CLBs.

 

So an XC6SLX25, with 3,758 CLBs would be the smallest I expect you could squeeze a high performance implementation of SHA-256 into. 

 

Mike

  • Like 1

Share this post


Link to post
Share on other sites

ok, so in theory, in an lx150, with 23038, then it could be possible to put 9 implementations of this in one chip?

I see that some implementations also mentions that they use the dsp slices also.

 

and typical speed you can get on an spartan6 is about 200mhz?, if it was possible to put 9 x 200 = 1800 mhashes out of one chip, it could be interresting.

 

I was reading some forumthreads that people say that the spartan have not enought wires for max performace, and some are using the 7 series instead, but those are quire expensive, so it's probably not worth it.

the ztex people have an bitcoin miner for lx150, which the get around 230mhashes out of, and an quadboard that gives around 860mhash/s, but the source looks quite small, so I wonder if they are using the full potential.. 

 

I'm quite sure I'm not capable of doing this, but it looks like an fun exercise.

Share this post


Link to post
Share on other sites

While it might be fun to get something going, I can't help but feel that the whole idea of the bitcoin is, while an interesting experiment, a dead end. A currency that fluctuates hugely in value is useless as a currency. Money should be made by circulation enabling the trade of tangible goods and services, not by hoarding the currency itself. I also suspect that assuming Moores Law holds true, processing power will continue to increase to the point where the effort required to produce a bitcoin is trivial. We're already to the point where some pocket devices pack more computing power than high end workstations of a decade or so ago, and some previously rather secure encryption can be cracked in a relatively short time just by brute force.

Share this post


Link to post
Share on other sites

I agree that bitcoin is a dead end in the long run, but so too will be real money. No matter how accumulated wealth ($s) the whole planet has we can't all retire at the same time.  It is only because we have faith that people will want to exchange our money for goods and services that it has any value. Even if we have big lumps of precious metals it only has value if people want it!

 

Once a critical number of bitcoins have been generated, a re-pricing occurs to try to restrict the value of mining. From wikipedia:

 

Currently, 25 new bitcoins are generated with every 10-minute block. This will be halved to 12.5 BTC during the year 2017 and halved continuously every 4 years after until a hard limit of 21 million bitcoins is reached during the year 2140.[1][7]

Share this post


Link to post
Share on other sites

While it might be fun to get something going, I can't help but feel that the whole idea of the bitcoin is, while an interesting experiment, a dead end. A currency that fluctuates hugely in value is useless as a currency. Money should be made by circulation enabling the trade of tangible goods and services, not by hoarding the currency itself. I also suspect that assuming Moores Law holds true, processing power will continue to increase to the point where the effort required to produce a bitcoin is trivial. We're already to the point where some pocket devices pack more computing power than high end workstations of a decade or so ago, and some previously rather secure encryption can be cracked in a relatively short time just by brute force.

 

Once a critical number of bitcoins have been generated, a re-pricing occurs to try to restrict the value of mining. From wikipedia:

 

Currently, 25 new bitcoins are generated with every 10-minute block. This will be halved to 12.5 BTC during the year 2017 and halved continuously every 4 years after until a hard limit of 21 million bitcoins is reached during the year 2140.[1][7]

 

As hamster has stated there are only ever going to be a set number of bitcoins and the block reward is halved as the number generated goes up so that every 4 years mining a block is worth half as much.

 

However this isn't exactly the reason why you are wrong about your assertion that producing botcoins will become trivial, mining a block consists of finding the hash for the block with some chunck of random data put into it at the specified place that is lower than a number called the difficulty, since this can only happen if the SHA-256 hash begins with some number of 0 bits and since the hash behaviour is difficult to predict, it is hard to find the data you have to add to the block to successfully mine it.  To avoid processing power increasing causing the system to become insecure, this difficulty is adjusted periodically to ensure the blocks continue to be mined at the rate of 1 every 10 minutes.  Thus as processing power goes up, the average rate of blocks being mined remains the same as it was designed to be.  However what does happen is that as the processing power of the most powerful computer in the network increases, the difficulty will tend to increase to compensate the faster solving of the problem, thus if enough high power machines enter the network, the chances of a low powered machine ever mining a block successfully are decreased.

 

The only point where mining a block would be trivial is if you could reliably and quickly solve for the random data needed to produce an all 0 SHA-256 hash of the block, since this would satisfy even the highest possible difficulty.

 

I agree that the fact that bitcoin has no value other than being tradable with others causes it to be difficult to price in it or otherwise use it, but the idea is interesting and the decentralization has some nice points, like no one being able to screw over vendors when customers get whiny.

 

Anyway sorry for my long ramblings, I hope it made some sense...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now