My spv node received in a nTx = 2 in headers message

0

I am coding an spv node for dogecoin. I am syncing the headers and I am exceping to have nTx=0 for all the headers received but for one of the headers i have a nTx = 2 and some weird data following...

{ version: 6422786,
 previousHash: 'b7ac5cc3ca94d8b154661cba795fc4912f3b6ce83a3c5669053e7f677b360dab',
 merklerootHash: 'd55d5c789080a64707a528ce06c80b36708910d80126f0b0f5c5a73534333354',
 time: 1407228150,
 nBits: 503697504,
 nonce: 0,
 hash: '47cf9eaf17f37672ef610c15c6aeb5257c318e76943b809d79c6fb486fd36115',
 transactionCount: 2 }

I am doing something wrong ?

rllola

Posted 2018-05-19T10:30:32.393

Reputation: 101

I think I might have found what I am doing wrong. At one point Dogecoin switch to AuxPow and so I believe that the headers might have a diifferent structure that the one in Bitcoin (because of the lack of documentation for DOGE I use the Bitcoin ones). Here a page which explain the differences : https://en.bitcoin.it/wiki/Merged_mining_specification

– rllola – 2018-05-19T14:26:03.630

Answers

0

I have found what I was missing.

Dogecoin switch to merged mining so the header has a new structure which I didn't know about. I found this wikipedia page (https://en.bitcoin.it/wiki/Merged_mining_specification#Merkle_Branch) which explain everything.

I should have noticed also that my nonce is 0. When I see this and that the next bit is not null I can extend my structure to a merged mining header.

I hope it will help people.

rllola

Posted 2018-05-19T10:30:32.393

Reputation: 101