Bitcoin Forum
June 22, 2024, 10:10:36 AM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Bitcoin / Mining / Re: Writing a Miner? on: July 01, 2011, 04:39:17 PM
The miner needs to send a POST http request to the server containing the authentication info and a json getwork struct and get the result like described by Zagitta.
   The data field is a int[32] (big endian ) , the first 20 integers are the actual block header that needs to be hased.
There are  other 12 ints because it's the first step of the sha256 algo(pseudocode here http://en.wikipedia.org/wiki/SHA-2 ). The midstate contains the a,b,c,d,e,f,g,h , registers of the sha256 transform after processing the first 512 bits chunk of data. Notice that for processing the first chunk , the nonce isn't needed, because it is contained in data[19] (last int of the actual header) that's why is handful to have them , because you can calculate the hashes starting from that point (actually you can go some step further because the nonce is in position 19, the processing of the fist chunk finish on 15 , you can process positions 16 17 18 , and start each calculation from there) . Your goal is to find a nonce to be inserted in header[19] for which sha256(sha256(header ) ) has a specified (by the difficulty ) number of final zero bits.
After finding the nonce you need to put it into the data[] field of the json sent by the server , put this data[] in a string , build a json getwork request , add to it a params array, put the string in the arra , send the json to the server. It will rely with an other json whose result field will be true if the solution was accepted.

I just finished writing my miner in c#.
I found really confusing  the endianess of integers for the sha256 transform. The ints in data[] are represented as big endian hex strings. If you parse the string '000000ff'(big endia) it will return the int 0xff , that's written in memory as 0xff000000 (if you use windows or linux) BUT when you perform the arithmetical operations on that number , the operators work as that is a big endina number. So for instance if you have the number int num = 0x1 , it's written in memory as  0x80000000 , but if you write int res = num << 1 , you get res = 2, becase << operate on the big endian representation.  This means that before doing your calculations you need to reverse the bytes of each int of the data array, because the sha256 transform requires to operate on little endian integers.
2  Local / Mercato valute / Re: [VENDO] Sapphire ATI Radeon HD 5870 1gb on: June 29, 2011, 08:55:14 AM
Mi sa che l'ha già venduta perchè io non ho avuto notizie
3  Local / Mining (Italiano) / Re: Minare in solitaria on: June 29, 2011, 08:38:24 AM
Ok penso che ora è chiaro spezzando i blocchi si ha un input al problema diverso.

In pratica invece di avere un un'unico blocco grosso 100 si hanno 10 blocchi grossi 10.
Il vantaggio c'è perchè risolvere un blocco da 100 è più impegnativo che risolvere 10 volte un blocco da 10, perchè la complessità cresce più che linerarmente con la grandezza dei blocchi.  Wink

Comunque qua in ufficio non riesco a connettermi ne al client ufficiale (i ragionamenti che ho fatto prima sono dovuti a prove fatte ieri sera da casa) ne ai pool tramite GUIMiner. Il firewall aziendale non mi permette di uscire su certe porte immagino.

Esistono interfacce web per partecipare ad un pool? Voglio dire una specie di sito dove tramite protocollo http ricevo l'input del mio problemino e il mio pc lo elabora e rimanda la soluzione sempre in http cosi si riesce a bypassare sto firewall?

No la complessità è sempre la stessa. L'algoritmo calcola l'hash dell'header del blocco , il quale è sempre 640bit che sono 80bytes e quindi un array di 20 int.
Insomma la grandezza dell'header è la stessa. I soldi guadagnati medi minando in pool sono gli stessi che guadagneresti minando in solitaria MA in pool hai un guadagno costante mentre in solitaria potresti non trovare un blocco per giorni ma quando lo trvi becchi 650 euro circa in un colpo solo.
In termini tecnici il mining in pool diminiusci la varianza della produzione.

Insomma se ti senti iperfortunato mina da solo e magari dopo 1 min di mining becchi un blocco Cheesy.
4  Bitcoin / Mining software (miners) / Re: another 3% mining increase with poclbm kernel.cl on: June 28, 2011, 07:14:40 PM
AFAIK declaring those variable as local will make theme shared for all the the threads in the workgroup so it's possible to have a performance increase because you are using less memory , but speed doesn't matter when the calculations are all fucked up! !
5  Other / CPU/GPU Bitcoin mining hardware / Re: DiabloMiner GPU Miner (Long Poll, BFI_INT, and never fail async networking) on: June 27, 2011, 09:13:24 PM
Probably i got it , you use two queues so you don't have to call clFinish to wait for the current work to end before reading the buffer.
6  Other / CPU/GPU Bitcoin mining hardware / Re: DiabloMiner GPU Miner (Long Poll, BFI_INT, and never fail async networking) on: June 27, 2011, 06:11:16 PM
In the part where you enqueue the work to the gpu and then read the output buffer , why do you alternate two buffers? ( buffer and output are two arrays of two buffers)
7  Bitcoin / Bitcoin Discussion / Re: Bitcoin Is Useless Because It's Too Easy Too Get Robbed on: June 25, 2011, 08:55:36 PM
Actually you can get robbed also using paypal ? And all other payment methods. Ok paypal can refound you taking the money from the account that robbed you , but do you think that after taking your money , the thief will leave the money in his account just for paypal to return them back to you ??
That's why there is reputation on ebay , because also using paypal you are not sure to receive what you buy.
There is also the possibility to be robbed when using cash actually.
8  Bitcoin / Pools / Re: [~350 GH/s] "Eligius" mining pool (still semi-experimental!) on: June 25, 2011, 01:19:06 PM
If this happened two times in a row , probably there is some problem?
9  Bitcoin / Pools / Re: Eligius: New payout method POLL on: June 24, 2011, 05:18:21 PM
The problem with Shared Maximum Pay Per Share is that in short lucky runds you get payed per share , instead if you get a long rounds streak there is the possibility that the credit isn't enough to pay all the shares and it switches to proportional method !!
This goes in favour to the pool hopping cheat!!
Btw we are in a very unlucky round Tongue 18 hours and still no block. Sad
10  Local / Mercato valute / Re: [VENDO] Sapphire ATI Radeon HD 5870 1gb on: June 24, 2011, 02:24:42 PM
Ma è anche in garanzia?
Di dove sei ? (per eventuale ritiro a mano )
11  Economy / Services / Re: Mom's Basement Mining Contracts - From $52 per week! on: June 24, 2011, 01:26:38 PM
Difficulty is doubled now , and the value of BTC has lowered , so the profit will be negative if you keep these prices.
12  Other / CPU/GPU Bitcoin mining hardware / Re: Hd4870 + hd5870 on the same machine? on: June 23, 2011, 05:20:48 PM
The OS is win7.
13  Other / CPU/GPU Bitcoin mining hardware / Hd4870 + hd5870 on the same machine? on: June 23, 2011, 05:13:57 PM
Is it possible tu use both gpus on the same system? Won't there be any driver conflict?
14  Other / CPU/GPU Bitcoin mining hardware / Re: Different PSUs for different GPUs on: June 23, 2011, 02:07:26 PM
Yes that was actually the only problem i was thinking about , differences in the grounds voltages. In theory there shouldn't be any difference , in reality it's possible.  How can i connect the two grounds. Is the case of the psu connected to it's ground ?
15  Other / Obsolete (selling) / Re: Selling compliments on: June 23, 2011, 12:44:43 PM
Is there something nice that can be said about me too ? Cheesy
16  Other / CPU/GPU Bitcoin mining hardware / Re: Going to upgrade my system, will my PSU be enough? on: June 23, 2011, 12:11:28 PM
If i'm not wrong each card needs 2 (6PIN PCI-E) connectors but that psu has only 2 of those connectors , this mean that you can't have 2 GPUs.
17  Other / CPU/GPU Bitcoin mining hardware / Different PSUs for different GPUs on: June 23, 2011, 12:00:22 PM
I'm thinking about buying a new GPU that i would add to my computer. The problem is that my PSU can't handle 2 GPUs so i thought about buying a new psu for the second GPU . Theorically there shouldn't be any problem , but has anyone tried that in practice? ?
18  Other / Beginners & Help / Re: Standalone FPGA miner board (large scale) on: June 23, 2011, 07:00:26 AM
Compared to other FPGA's i've seen this is a pretty good price.

But potential ROI ?

Assuming we get an average price of 10$/BTC and average difficulty of 4mill... Would yield ~$328.70/mo, or 63 months to payoff. (thats still ~18% return per year, if this holds which is pretty good as an investment)


The problem is that the difficulty is increasing, in the next inrease will be almost doubled and so also the payback time , and also you can't forsee what will happen in 63 months.
19  Other / CPU/GPU Bitcoin mining hardware / Re: Official DiabloMiner GPU Miner Thread (now with Long Poll and BFI_INT support) on: June 22, 2011, 11:39:44 AM
 I'm having a look at your code because i would like to understand how a miner works.
I have a few questions.
Where i can find how is stored the data contained in the work sent to the miner from the server ?
Also could you explain a little bit in few words what happens in lines of code between 888 and 944?
Here:
Code:
 bufferIndex = (bufferIndex == 0) ? 1 : 0;

          workSizeTemp.put(0, workSize);
          currentWork.update(workSizeTemp.get(0) * loops * vectors);

          System.arraycopy(currentWork.midstate, 0, midstate2, 0, 8);

          sharound(midstate2, 0, 1, 2, 3, 4, 5, 6, 7, currentWork.data[16], 0x428A2F98);
          sharound(midstate2, 7, 0, 1, 2, 3, 4, 5, 6, currentWork.data[17], 0x71374491);
          sharound(midstate2, 6, 7, 0, 1, 2, 3, 4, 5, currentWork.data[18], 0xB5C0FBCF);

          int fW0 = currentWork.data[16] + (rot(currentWork.data[17], 7) ^ rot(currentWork.data[17], 18) ^
                    (currentWork.data[17] >>> 3));
          int fW1 = currentWork.data[17] + (rot(currentWork.data[18], 7) ^ rot(currentWork.data[18], 18) ^
                    (currentWork.data[18] >>> 3)) + 0x01100000;
          int fW2 = currentWork.data[18] + (rot(fW0, 17) ^ rot(fW0, 19) ^ (fW0 >>> 10));
          int fW3 = 0x11002000 + (rot(fW1, 17) ^ rot(fW1, 19) ^ (fW1 >>> 10));
          int fW15 = 0x00000280 + (rot(fW0, 7) ^ rot(fW0, 18) ^ (fW0 >>> 3));
          int fW01r = fW0 + (rot(fW1, 7) ^ rot(fW1, 18) ^ (fW1 >>> 3));

          int fcty_e = currentWork.midstate[4] + (rot(midstate2[1], 6) ^ rot(midstate2[1], 11) ^ rot(midstate2[1], 25)) +
                       (midstate2[3] ^ (midstate2[1] & (midstate2[2] ^ midstate2[3]))) + 0xe9b5dba5;
          int fcty_e2 = (rot(midstate2[5], 2) ^ rot(midstate2[5], 13) ^ rot(midstate2[5], 22)) + ((midstate2[5] & midstate2[6]) |
                        (midstate2[7] & (midstate2[5] | midstate2[6])));

          int fcty_e_plus_e2 = fcty_e + fcty_e2;
          int fcty_e_plus_state0 = fcty_e + currentWork.midstate[0];
I also noticed that i get 'Spurious CL_INVALID_KERNEL_ARGS error, ignoring' when running with -d enabled, what could it be ?
Thanks for the patience Cheesy
20  Other / Beginners & Help / Re: Joined a mining pool, but none of my work earns shares?? on: June 22, 2011, 06:31:06 AM
Here you can find how much time in average it will take for you to generate a share
http://www.alloscomp.com/bitcoin/old_calculator.php
The common difficulty for shares is 1 , so put '1' in the difficulty field and 30000 in the speed field then hit calculate.
Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!