And my second question is that somehow the output is the same, but actually it's not what I am expecting.
I get a long address of 75 bytes, while the payments are made on addresses of 43 bytes. So I am expecting an address of 43 bytes.
Looking more carefully at the output, I noticed that the addresses are matching minus the "checksum":
Original address: ert1q989xa8zz0a4fs7zrsmfsacwkvnup8vyd 27xnhv
p.WitnessPubKeyHash(): ert1q989xa8zz0a4fs7zrsmfsacwkvnup8vyd 989xa8zz0a4fs7zrsmfsacwkvnup8vydul8w9d
But a checksum of 38 chars for WitnessPubKeyHash not sure, that makes sense.
So isn't there too much data in the p.WitnessHash? It looks like it.
I have been able to recompute the address I was expecting with the right checksum, by using bech32.ConvertBits on p.WitnessHash then cutting the results to keep the 32 first bytes.
So that kind of comforts me into that idea that there are too much data in WitnessHash, or (most likely) just something out of my knowledge.
Hi,
I was wondering something.
I am making P2WPKH payments with an application, and from another one I try to read the blocks and retrieve any payment made by the other application.
So my first question is why the output of the two lines:
is the same?
And my second question is that somehow the output is the same, but actually it's not what I am expecting. I get a long address of 75 bytes, while the payments are made on addresses of 43 bytes. So I am expecting an address of 43 bytes.
Looking more carefully at the output, I noticed that the addresses are matching minus the "checksum":
But a checksum of 38 chars for WitnessPubKeyHash not sure, that makes sense.
So isn't there too much data in the p.WitnessHash? It looks like it.
I have been able to recompute the address I was expecting with the right checksum, by using bech32.ConvertBits on p.WitnessHash then cutting the results to keep the 32 first bytes.
So that kind of comforts me into that idea that there are too much data in WitnessHash, or (most likely) just something out of my knowledge.
Sorry the lengthy message, thanks for your help