Post
Topic
Board Development & Technical Discussion
Merits 8 from 3 users
Re: How to convert a compressed public key into uncompressed one in Python?
by
PowerGlove
on 30/08/2022, 15:22:56 UTC
⭐ Merited by SamYezi (4) ,Welsh (3) ,odolvlobo (1)
The Python script you've already discovered, over here works correctly as far as I can tell.

Substituting your example keys into the "compressed_key" variable on line 12 and running the script three times produced the following results:

compressed_key = '025A2146590B80D1F0D97CC7104E702011AFFF21BFAF817F5C7002446369BA9DDC'
Code:
045a2146590b80d1f0d97cc7104e702011afff21bfaf817f5c7002446369ba9ddc9bd5dcd1b4a737244d6bb7b96e256391b8597d3a7972a6f8ca9096d4aea1f37e

compressed_key = '035728F4692D85D411DF3643CD69FE05C411A0D507C7D814008F56C8F260AD7ED9'
Code:
045728f4692d85d411df3643cd69fe05c411a0d507c7d814008f56c8f260ad7ed99e2df8d9cb1a575d55264692629ae22e518bc14ad02592941c13be6755c72973

compressed_key = '039E87EB177890FDD788B95843ED53AD4FB6E877E3F730EF1E73593964C2AB9D15'
Code:
049e87eb177890fdd788b95843ed53ad4fb6e877e3f730ef1e73593964c2ab9d15a3b647c8c4a0766420917b7b445cdcd6bfec2900175c5534c6113954f3ff00d9