I'm trying to understand Bitcoin address encodings. I understand there's three (four?) different address encodings P2PKH, P2SH, Bech32, and Bech32m (Bech32m just uses a different constant when XORing). They all encode the public key using Ripe160 (RIPEMD160?). I was able to use some libraries to extract the ripe160 encoded address, which should be 20 bytes, but there are some longer strings in this list of addresses with currency:
Bitcoin addresses with currency from loyce.com
They start with
bc1 so that indicates Bech32, correct? When decoding using something like bech32-buffer I get 32 bytes.
In doing some more digging, there's also this scriptPubKey encoding. Is that what these long encodings are? How do you differentiate them? I assume since the site is listing address with currency, I should be able to pull the ripe160 address from the script, are there any recommended parsers?
I found another post which suggests doing pattern matching, and pulling the parsing code from Bitcoin Core. Am I heading down the correct path here?