Please correct me if i'm wrong:
So, with segwit v0 we know that 20 bytes is equal to P2WPKH, and 32 bytes is equal to P2WSH, and thus we can identify the address type by decoding the 31 byte or 43 byte bech-32 encoded string.
so we get decoded 0 < hash of pubkey > or 0 < sha hash of redeem script >, and identify the sender address type
Now I read that there has been some testing done with newer bech versions (bech32m) for P2WSH (or P2TR?) addresses, and also comments that some testing resulted in funds being lost, which confused me. (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-November/018268.html)
A) Considering funds got lost on mainnet using bech32m encoding (or was it p2tr v1+ using bech32?), am i correct in assuming that P2WPKH/S scripts can have a witness version of 1 (bech32m), else: how could this have been tested on mainnet (or can you generate valid p2tr addresses already, but just not spend from them? is that it?) -> I guess that would make sense considering a v1 taproot address would look identical to a v1 P2WSH address?
->> if so, how can we differentiate between script hashes of P2WSH 1 <32 byte hash of redeem script>, and taproot 1 <public key 32 bytes>
as address indication is done purely based on "script size", and why is this not done in above link? Would this be considered "unstandard" - if so, why was there such an emphasis on testing this? I don't understand how this was a surprise?
B) If this is not the case and it was indeed P2TR adddresses which did not decode correctly using bech32, why then was this the case exactly, considering the only thing that bech32m changes is the checksum? As in; the decoding process did not change as a result of this BIP.
A quote from the BIP:
This does not affect existing uses of witness version 0 BIP173 addresses due to their restriction to two specific lengths, but may affect future uses and/or other applications using the Bech32 encoding.
addresses using P2TR also have a restricted length, right?