Bitcoin Forum
May 12, 2024, 07:02:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / CBlockHeader::nTime, is that a problem? on: December 29, 2017, 07:05:30 AM
I find out that more than 2% block Timestamp(nTime) is wrong.

for example:
Block#501251  Timestamp 2017-12-27 10:34:56
Block#501252  Timestamp 2017-12-27 10:34:39

I think more than 2% is too lot.
Should we design some protocol let every miner use correct time?
2  Bitcoin / Development & Technical Discussion / what is the struct of value in the leveldb when use 'b' + block hash as a key on: December 27, 2017, 10:17:21 AM
when i use 'b' + block hash as a key search the leveldb,  i can not figure out the struct of values.

for exmaple:
search 'b' + "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"       //  Block #0

value 88bytes:
889271000b010008010000000000000000000000000000000000000000000000000000000000000 0000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f 49ffff001d1dac2b7c

i know the last 80bytes is the block header,  but the first 8bytes , i do not known what it is?
"889271000b010008" HuhHuh

plz tell me the struct or tell me which .cpp contain the struct, thanks a lot!
3  Bitcoin / Development & Technical Discussion / confused at CScriptCompressor::Decompress() on: November 30, 2017, 02:46:02 AM
bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigned char> &in)
{
    switch(nSize) {
    case 0x00:
        script.resize(25);
        script[0] = OP_DUP;
        script[1] = OP_HASH160;
        script[2] = 20;
        memcpy(&script[3], in.data(), 20);
        script[23] = OP_EQUALVERIFY;
        script[24] = OP_CHECKSIG;
        return true;
    case 0x01:
        script.resize(23);
        script[0] = OP_HASH160;
        script[1] = 20;
        memcpy(&script[2], in.data(), 20);
        script[22] = OP_EQUAL;
        return true;
    case 0x02:
    case 0x03:
        script.resize(35);
        script[0] = 33;
        script[1] = nSize;
        memcpy(&script[2], in.data(), 32);
        script[34] = OP_CHECKSIG;
        return true;
    case 0x04:
    case 0x05:
        unsigned char vch[33] = {};
        vch[0] = nSize - 2;
        memcpy(&vch[1], in.data(), 32);
        CPubKey pubkey(&vch[0], &vch[33]);
        if (!pubkey.Decompress())
            return false;
        assert(pubkey.size() == 65);
        script.resize(67);
        script[0] = 65;
        memcpy(&script[1], pubkey.begin(), 65);
        script[66] = OP_CHECKSIG;
        return true;
    }
    return false;
}


I know a common TX is a UTXO,  in case 0x00:
push/out/op following in stack.
SIG, PUBkey, OP_DUP, OP_HASH160, ADDRESS,  OP_EQUALVERIFY, OP_CHECKSIG.
that meaning is
OP_DUP, copy PUBKEY
OP_HASH160, calculate this pubkey's address
OP_EQUALVERIFY, make sure this pubkey's address equal sender's address
OP_CHECKSIG, make sure SIG correct

but , i do not understand case 0x01:
I think there less a op_checksig?
is that meaning everyone can do spend another one's bitcoin, because do not need OP_CHECKSIG.

and aslo i do not understand case 0x02,03, 04,05 ??
what is it designed for ?

Thanks a lot!

4  Bitcoin / Development & Technical Discussion / why every blk00000.dat is different in every wallet? on: November 20, 2017, 11:22:52 AM
I am a new one studying bitcoin source. I think that maybe writing a blockchain parser is first step. I realize that every blk00000.dat is different.  I got 2 different blk00000.dat.  I compared the files as below.

You can see the Magic Number, Size, Version, and the PreHash are different.
I had read https://github.com/bitcoin/bitcoin/issues/6613, but I am still confused.
If there is a key to XOR to make difference, why the blocks before do not XOR? And obviously, Magic Number, Size, Version do not XOR, which field will be XOR?

Thanks a lot!!!!
 

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!