Author

Topic: how to develop a program to solve bitcoin (Read 1041 times)

newbie
Activity: 2
Merit: 0
March 19, 2017, 12:32:28 PM
#7
thanks a lot every body
thanks DannyHamilton, misterbigg, Benchich, Quartx and Igor Tatarov
legendary
Activity: 3528
Merit: 4945
inputs is the previous blockchain

This is incorrect.

The input is the block header of the new block.

You build a block header with the following 80 bytes of information:
  • (4 bytes) version number
  • (32 bytes) Double sha256 hash of the most recent block in your blockchain
  • (32 bytes) Merkle root of transaction list
  • (4 bytes) timestamp
  • (4 bytes) encoded current difficulty
  • (4 bytes) nonce

The Merkle root is calculated by choosing the transactions that you want to include in your block, arranging them in the order you want them and then generating a Merkle tree using the SHA256 hash function.

The nonce is simply incremented after each calculation until one of the following has occurred:
  • You've tried all possible nonce values, and you now need to either update your timestamp or generate a new Merkle Root
  • You've received a valid block from a peer, and you now need to start the process over with a new double sha256 hash of the most recent block in your blockchain
  • You find a valid solution, and you now need to broadcast it to your peers and start the process over with a new double sha256 hash of the most recent block in your blockchain

then some mathematical formulas

Specifically a SHA256 hash of the header, followed by a SHA256 hash of that result (often called a double SHA256 hash).
https://en.wikipedia.org/wiki/SHA-2

out put a new block

Specifically, broadcast the block to all the peer that are connected to you.

legendary
Activity: 1064
Merit: 1001
Simple program to "solve" bitcoin:
Code:
extern bool activateSegwit;
extern void runNode();

int main()
{
    activateSegwit = true;
    runNode();
}
newbie
Activity: 5
Merit: 0
I can say that the block chain provides Bitcoin’s public ledger, an ordered and timestamped record of transactions. This system is used to protect against double spending and modification of previous transaction records.

Each full node in the Bitcoin network independently stores a block chain containing only blocks validated by that node.
hero member
Activity: 1036
Merit: 504
Becoming legend, but I took merit to the knee :(
It is not hard to find resources on the math behind bitcoin. Do you really know how bitcoin works in general? The cryptography it uses, the pros and the cons on what makes it a good p2p system + currency?

https://bitcoin.org/bitcoin.pdf
http://www.coindesk.com/math-behind-bitcoin/
newbie
Activity: 9
Merit: 0
newbie
Activity: 2
Merit: 0
i am kind new in this business and i would like to know what is the inputs the SW take and what it should return as outputs

my conclusion of what i read and might i got some wrong info

inputs is the previous blockchain

then some mathematical formulas

out put a new block

what i need to know what is the right inputs and what is the mathematical formulas

thanks and i really will appreciate your help
Jump to: