You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the BCR-2020-006 standard defines the crypto-address UR type but the definition is a little bit ambiguous.
On Example/Test Vector 1 the specified P2PKH address 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 does not include the type of the address in the encoded CBOR, making it ambiguous to differentiate between it P2SH and P2PKH as these are both 20-byte hashes.
On the CDDL comment it should also:
- ; For addresses of type `p2wphk`, the sha256 of the script bytes (32 bytes).+ ; For addresses of type `p2wpkh`, the witness program (20 bytes).
It is not a script hash but the witness program and for P2WPKH it is 20 bytes, for P2WSH it is 32 bytes.
P2WSH could be also added and P2TR addresses too.
So:
P2PKH, P2SH and P2WPKH types of addresses use 20-bytes of data.
P2WSH and P2TR use 32-bytes of data.
I think to differentiate these the type field should be always included when info specifies a Bitcoin address. Also maybe the info field should have a .default specifier but I don't know if CDDL allows that for maps or if the behavior is to skip a field in a map completely when all the fields of the inner map can be ommited because of the default values.
The text was updated successfully, but these errors were encountered:
Currently the BCR-2020-006 standard defines the crypto-address UR type but the definition is a little bit ambiguous.
On Example/Test Vector 1 the specified P2PKH address
1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
does not include the type of the address in the encoded CBOR, making it ambiguous to differentiate between it P2SH and P2PKH as these are both 20-byte hashes.On the CDDL comment it should also:
It is not a script hash but the witness program and for P2WPKH it is 20 bytes, for P2WSH it is 32 bytes.
P2WSH could be also added and P2TR addresses too.
So:
I think to differentiate these the
type
field should be always included wheninfo
specifies a Bitcoin address. Also maybe theinfo
field should have a.default
specifier but I don't know if CDDL allows that for maps or if the behavior is to skip a field in a map completely when all the fields of the inner map can be ommited because of the default values.The text was updated successfully, but these errors were encountered: