Closed qwang12 closed 3 years ago
Sorry, I just realized my mistake then I delete my post. Thank you for your reply.
Your wonderful code gives out only two WIFI keys not counting the test network Private Key WIN Private Key WIF compressed: There's only one address Public Address 1: No compressed address 1 no WIFI keys from Public Address 3: Public Address bc1 P2WPKH: Public Address bc1 P2WSH: And the output is something like a package of calculations with a bunch of spaces after the keys and in the lines too Thanks for your attention
ver 0.1.2
=== (whitespaces)
Private Key HEX: 02e0a8e3c33e6a02bd1697532be291cf7dd87743f8d14f7951f93c17e2593fb9=
Private Key WIF: 5HqZ5uP3794ZLYNHccFPaCzRdbykXHUAqdZZXvWUCJdBi8dGd2n
Private Key WIF compressed: KwKJceCGJ6ahjFSxLAaWdZvTiZPV6fgvReNibVB52tniGLVdU1Qf
Private Key WIF (TESTNET): 91cBfeCahN8hJbsaEx9JSoYPHGLTgT1NBaRWcYryY3NEVB21nfQ
Private Key WIF compressed (TESTNET): cMgJ5ZC7jAGxtgvDiaPdztRXLngtm7ncVgXBhudaY1SiX5bH49Ai
=======
Public Key: 04132b92c5d3399ed17f377a11ee118e294e3d2611858aa59090c6e5e354538e76d9af8bc1bd8ed8af31531062f1d5c5da0f282000d7a5d7c090a845568b8e569c
Public Key compressed: 02132b92c5d3399ed17f377a11ee118e294e3d2611858aa59090c6e5e354538e76
Public Address 1: 1EU3gvhcAdLyLpqMvjKvRBnsqeZMoivSmV===
Public Address 3: 34VRqybYsZ8RSQ6A27MHh2wY1JQRdDJYTX===
Public Address bc1 P2WPKH: bc1qxmha907hm39k89ax52ga3mt9g58z7l4hd533f7q5zxqmffdt2wgsmccyv6===
Public Address bc1 P2WSH: bc1qlm4q3qen7lkt2hchy2xwgu0f9mvmp0eva99sa7==
Public Address 1 (TESTNET): mtyzyynayenE7wJyeJJJF71CheA4n33dAC===
Public Address 3 (TESTNET): 2Mv3duiXaV1dmeBihhEyAJyvoDecbMQCnW6===
Public Address tb1 P2WPKH (TESTNET): tb1qxmha907hm39k89ax52ga3mt9g58z7l4hd533f7q5zxqmffdt2wgsvswtk4
Public Address tb1 P2WSH (TESTNET): tb1qlm4q3qen7lkt2hchy2xwgu0f9mvmp0evhr7rxd
@Sibtigr
len(wallet.address.__dict__['pubaddr1']) == len(wallet.address.__dict__['pubaddr1'].strip()
result: True
The Problem is, the script shows a wrong compressed public key. compressed public keys should begin with 02 (y even) or 03 (y odd). I get: pubk_uncompressed: 04a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235 pubk_compressed: 14a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd this line in address.py looks like it: def _generate_publicaddress_bech32_testnet(self): _p = self.__generate_compressed_pubkey(b'\x02', b'\x14')
why \x14 and not \x03 ? Is that for bech32 alright?
I just changed it from (b'\x02', b'\x14') to (b'\x02', b'\x03') and the compressed public key is alright. I created an address from it and it looks well like an P2PKH compressed address.
I don't know if it is okay to the oher script parts, but everything looks alright.
We are not generating compressed public addresses yet. I or someone will implement it as soon. You are comparing the segwit address type 3 with compressed public address....
Cheers.
On Thu, 12 Nov 2020 at 16:39, Qi WANG notifications@github.com wrote: