Due to the spam attacks in recent months, I was searching for a precise formula to estimate transaction size so I can attach enough fees for a quick conformation. To my surprise, there are 2 formulas:
TX Size = 180 bytes per input + 34 bytes per output + 10 bytes +/- number of inputs
TX Size = 148 bytes per input + 34 bytes per output + 10 bytes +/- number of inputs
Wanting to verify which one is correct, I stumbled upon "uncompressed public keys" and "compressed public keys" (there are always new things to learn about bitcoin). Compressed public keys make transactions smaller! I learnt that this is actually a legacy issue since nearly all current wallets use "compressed public keys". My address is still using "uncompressed public keys" because I created my address a long time ago (on a wallet service who was slow to update).
So all these years, I have been creating "oversized" transactions and they are bloating the blockchain. I checked my private keys of my addresses. My ancient addresses all begin with "5" and my newer addresses begin with "K" or "L". At least, I know that my wallet provider now supports "compressed public keys".
How can I convert my private key so its public key is compressed?