Bitcoin Forum

Bitcoin => Hardware => Topic started by: smith2199 on October 30, 2014, 07:31:47 PM



Title: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: smith2199 on October 30, 2014, 07:31:47 PM
I'm trying to use the Antminer U2 as a fast SHA256 hash generator.  I would like to send my own original data and receive an output of it's sha256 hash.

Is there an API or other information somewhere on how to get direct access to the Antminer's functions?

smith2199


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: TheRealSteve on October 30, 2014, 07:57:16 PM
That's generally not how miners work.

Have a look at, for example, the cgminer source code to see how a program communicates with several types of miners:
https://github.com/ckolivas/cgminer

You're probably much better off with a GPU-based approach for what you need.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: Prelude on October 30, 2014, 08:07:59 PM
If it's not bitcoin based mining, it won't work. It can't do anything else.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: smith2199 on October 30, 2014, 10:50:07 PM
Thanks, I will look at cgminer code.

As a general knowledge question, is the miner doing more than the 2 SHA256 hashes needed for bitcoin?  I kind of saw it as each miner running the hashes through a group of nonces and reporting back the results.  Is that correct?  Do they return all hash values, or only the first one to meet the target?  Or am I completely off on how I see this?

The data I want to run is bitcoin formatted (previous hash, merkle, etc.).  I'm just looking for how to input that data and get the hash results back from the miner if possible.

Thanks again.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: TheRealSteve on October 31, 2014, 12:57:53 AM
As a general knowledge question, is the miner doing more than the 2 SHA256 hashes needed for bitcoin?  I kind of saw it as each miner running the hashes through a group of nonces and reporting back the results.  Is that correct?  Do they return all hash values, or only the first one to meet the target?  Or am I completely off on how I see this?
The particulars probably vary per miner, but generally it's the latter case - so you send it the information to hash and the target difficulty, and the hardware then hashes until it finds one that is below ( or is that above? depends on how you look at it ;) ) that difficulty at which point it returns the data needed for that calculation so that software can verify/etc.

One way that you could do what you're trying to do - sort of - is by setting that difficulty really high (or is that low...), so that the hardware basically finds a result on the first try.  I'm not sure if that's entirely possible, or if hardware is going to freak out, but... theoretically anyway.

As for particulars, again, see cgminer source code - or bfgminer source code (https://github.com/luke-jr/bfgminer) / MultiMiner source code (https://github.com/nwoolls/MultiMiner) (there's probably others).  You'll probably have to do a bit of untangling as most of these projects are set up to work with various pieces of hardware, so they modularize their functions, files, etc.  If you get stuck, you can also ask their authors for some help, they're decent chaps :)

Dare we ask what it is you're trying to do? :)


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: -ck on October 31, 2014, 01:35:17 AM
I'm trying to use the Antminer U2 as a fast SHA256 hash generator.  I would like to send my own original data and receive an output of it's sha256 hash.
You can't. ASIC miners don't do full sha256 and there is no way of untangling just sha256 output from them.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: tolip_wen on November 01, 2014, 10:46:01 AM
I'm trying to use the Antminer U2 as a fast SHA256 hash generator.  I would like to send my own original data and receive an output of it's sha256 hash.

Is there an API or other information somewhere on how to get direct access to the Antminer's functions?

smith2199

An ASIC is not required for SHA256 hash creation.
'Creating' the hash is not as computationally intense as testing it.

There are programs for a PC with a CPU that will do it.
There is even javascript code that runs locally in a browser that will do it.

Google 'create your own BTC wallet/address' or some such.


YMMV
:)


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: Soros Shorts on November 01, 2014, 11:54:24 AM
I'm trying to use the Antminer U2 as a fast SHA256 hash generator.  I would like to send my own original data and receive an output of it's sha256 hash.

Is there an API or other information somewhere on how to get direct access to the Antminer's functions?

smith2199

An ASIC is not required for SHA256 hash creation.
'Creating' the hash is not as computationally intense as testing it.

There are programs for a PC with a CPU that will do it.
There is even javascript code that runs locally in a browser that will do it.

Google 'create your own BTC wallet/address' or some such.


YMMV
:)

Well, OP was looking for a fast hash generator, so presumably using a CPU or GPU wasn't fast enough for him.

Edit: Actually I just realized that without knowing the size of the data he was trying to hash you couldn't even select a suitable architecture.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: Undefeatable on November 01, 2014, 01:31:34 PM
I'm trying to use the Antminer U2 as a fast SHA256 hash generator.  I would like to send my own original data and receive an output of it's sha256 hash.

Is there an API or other information somewhere on how to get direct access to the Antminer's functions?

smith2199

I dont get what you are trying to do? Are you going to mine with the antminer?


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: richardamullens on November 01, 2014, 07:30:50 PM
I found https://rpiplayground.wordpress.com/ with a google search.

Like you, I wondered if there was any other use for the Antminer U series - cracking passwords perhaps - but it seems not.


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: -ck on November 01, 2014, 09:18:42 PM
I found https://rpiplayground.wordpress.com/ with a google search.

Like you, I wondered if there was any other use for the Antminer U series - cracking passwords perhaps - but it seems not.
https://bitcointalk.org/index.php?topic=743571.0


Title: Re: How can I send data directly to an Antminer u2 and receive sha256 hash back?
Post by: richardamullens on November 02, 2014, 12:18:26 AM
I found https://rpiplayground.wordpress.com/ with a google search.

Like you, I wondered if there was any other use for the Antminer U series - cracking passwords perhaps - but it seems not.
https://bitcointalk.org/index.php?topic=743571.0

Thanks :)
As you say: Door stop, book end, paper weight and boat anchor.