Hi,
How to convert time from Block header to Unix time ?
Time stamp in block header ( past hashed blocks) is in the following format
http://blockchain.info/en/block-index/458660/00000000000000000fcea0d175785506f4681dc94d1fcf50deeda8082caf1543Timestamp 2014-01-15 15:33:34
I need it converted into Unix epoch time
as declared by
Block hashing algorithm
Time Current timestamp as seconds since 1970-01-01T00:00 UTC Every few seconds 4
in PHP
$time = littleEndian(1305998791);
header_hex = ("01000000" +
"81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000" +
"e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b" +
"c7f5d74d" +
"f2b9441a" +
"42a14695")
fourth parameter in Python code
file:///E:/Block%20hashing%20algorithm%20-%20Bitcoin.htmor in plain C
http://pastebin.com/bW3fQA2a // we are going to supply the block header with the values from the generation block 0
header.version = 1;
hex2bin(header.prev_block, "0000000000000000000000000000000000000000000000000000000000000000");
hex2bin(header.merkle_root, "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b");
header.timestamp = 1231006505;
header.bits = 486604799;
header.nonce = 2083236893;
I plan to read input parameters ( block headers ) from blocks hashed in the past to verify nonce
as a presentation to students.
Can you help me ?