Somebody can tell me with sure, what is the max number of characters in a bech32 address?
Id like to validate the max number of characters inside a database, so, that is important, after some google i still didnt found one exact answer!
As asnswered in this thread: 62 characters.
The reason you might not have found one answer is because there is a difference in length between a P2WPKH-address and a P2WSH-address:
- P2WPKH: 42 characters
- P2WSH: 62 characters
Also mentioned in this thread: P2WSH contains the SHA256 of a script, which is longer than the hash160 of a pubkey in the shorter P2WPKH address. That's the reason the length differ.
it should be noted that the length depends on the script each address represents and these numbers here are for version 0 witness program and may be different for version 1+ witness programs.
Id like to validate the max number of characters inside a database,
what kind of "database" contains addresses?