Author

Topic: How To Find a Block? (Read 9285 times)

legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
September 20, 2012, 05:38:03 AM
#10
Download the client. Run the client. Let it download the block chain. Issue it a "getwork" RPC request. You now need to do a double SHA-256 using every possible 32-bit nonce, all 2^32 of them. Should you find a nonce that produces a hash less than the target, report that back to the client using a "getwork" RPC as soon as possible.

See this thread: https://bitcointalksearch.org/topic/trying-to-understand-the-getwork-api-function-12862
full member
Activity: 140
Merit: 100
September 20, 2012, 05:24:51 AM
#9
How Can i find these:

Version : Block version number
Previous hash : Hash of the previous block
Merkle root : 256-bit hash based on all of the transactions
Timestamp : Current timestamp
"Bits" : Current target in compact format
Nonce : 32-bit number (starts at 0)
full member
Activity: 140
Merit: 100
September 18, 2012, 03:07:10 PM
#8
I'm not going to write your program for you (unless you pay me up front with BTC).  I give up.

i did not ask you to write the program for me i asked once i generate a hash from my program what should i do to my hash after that?

i am generating the hash from the info provided here : https://en.bitcoin.it/wiki/Block_hashing_algorithm

can anyone tell me what should i do to the hash once i generate it?
legendary
Activity: 3472
Merit: 4801
September 18, 2012, 02:57:57 PM
#7
I'm not going to write your program for you (unless you pay me up front with BTC).  I give up.
full member
Activity: 140
Merit: 100
September 18, 2012, 02:55:00 PM
#6
Once i generate a hash from my program what should i do to my hash after that?
legendary
Activity: 3472
Merit: 4801
September 18, 2012, 02:46:07 PM
#5
Not a lot of technical details here, but this is a good start to understanding the concept of how mining works:

http://codinginmysleep.com/bitcoin-mining-in-plain-english/

Once you've got a good understanding of what mining is, you can look at the protocol specification to figure out how to program a miner:

https://en.bitcoin.it/wiki/Protocol_specification

https://en.bitcoin.it/wiki/Getwork



i would like to know what should my program do in order to find a block?
Read the information at those links and you'll have the answer to your question.  If you can't figure it out from the information provided, you probably aren't capable of writing a workable computer program to accomplish your intended task.

Specifically as stated in one of those links:

Quote
The SHA256 hash that identifies each block (and which must have a run of 0 bits) is calculated from the first 6 fields of this structure (version, prev_block, merkle_root, timestamp, bits, nonce, and standard SHA256 padding, making two 64-byte chunks in all) and not from the complete block. To calculate the hash, only two chunks need to be processed by the SHA256 algorithm. Since the nonce field is in the second chunk, the first chunk stays constant during mining and therefore only the second chunk needs to be processed. However, a Bitcoin hash is the hash of the hash, so two SHA256 rounds are needed for each mining iteration. See Block hashing algorithm for details and an example.

Block hashing algorithm is seen at this link (as found in the information from one of those previous links I posted):
https://en.bitcoin.it/wiki/Block_hashing_algorithm
full member
Activity: 140
Merit: 100
September 18, 2012, 02:16:17 PM
#4
Not a lot of technical details here, but this is a good start to understanding the concept of how mining works:

http://codinginmysleep.com/bitcoin-mining-in-plain-english/

Once you've got a good understanding of what mining is, you can look at the protocol specification to figure out how to program a miner:

https://en.bitcoin.it/wiki/Protocol_specification

https://en.bitcoin.it/wiki/Getwork



i would like to know what should my program do in order to find a block?
legendary
Activity: 1102
Merit: 1014
September 18, 2012, 02:09:20 PM
#3
You can also google for my free ebook Introduction to Bitcoin Mining to get you a nice overview.
legendary
Activity: 3472
Merit: 4801
September 18, 2012, 02:00:35 PM
#2
Not a lot of technical details here, but this is a good start to understanding the concept of how mining works:

http://codinginmysleep.com/bitcoin-mining-in-plain-english/

Once you've got a good understanding of what mining is, you can look at the protocol specification to figure out how to program a miner:

https://en.bitcoin.it/wiki/Protocol_specification

https://en.bitcoin.it/wiki/Getwork

full member
Activity: 140
Merit: 100
September 18, 2012, 01:50:58 PM
#1
how does the miner's find a block? e.g (what is the algorithm used in generating a block)

and what is done by a miner to find a block? e.g (what calculation's is done by a miner)

and how does the Bitcoin-Qt verify that a block is valid?

and if i were to develop my own program to mine what should i do in my program?
Jump to: