Hi,
I try to implement creation of Payment Request structure based on:
https://bitcoin.org/en/developer-examples#code-variables .
I have set up environment(bitcoind, python CGI) and now I want to receive payment via P2PKH (as presented in the example). To do so I have to generate
pubKeyHash for each invoice.
Based on what I have read
pubKeyHash is a RIPEMD-160( SHA256( full/uncompressed ECDSA public key ) ).
Unfortunately I didn't find any
RPC call to get pubKeyHash .
So my guess is that to compute such a hash I have to perform the following steps:
1. call, via RPC,
getnewaddress, it will return new address for given shop payment
2. call, via RPC,
validateaddress, from returned json I can extract compressed public ECDSA key
3. compute uncompressed public ECDSA key based on methods which can be found on the Internet
4. compute (using openssl) SHA256 and RIPEMD-160 of the uncompressed key, result is a pubKeyHash which I have to put to Request Payment structure
Is approach presented above correct ? Or maybe there is easier way to get the pubKeyHash ?
Thanks in advance !!