Bitcoin Forum
May 09, 2024, 02:48:26 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How are BIP173 test vectors "valid"?  (Read 187 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 24, 2019, 01:40:57 PM
Merited by ABCbits (1)
 #1

There are 7 test vectors at the top of the list that are supposed to be "valid Bech32" but I can't see how they are valid.
These have no data since the bytes after the separator is the 6 byte checksum:
A12UEL5L
a12uel5l
an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharacter sbio1tt5tgs
?1ezyfcl


These have data but none of them are properly padded! They all have leftover non-zero bites (3 or 5)!
abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw
11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqc8247j
split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w


I can get the first group being valid since that is just encoding of empty data (which is not SegWit address and just encoding) but the second group doesn't make sense, shouldn't the data be properly padded in those too?

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715222906
Hero Member
*
Offline Offline

Posts: 1715222906

View Profile Personal Message (Offline)

Ignore
1715222906
Reply with quote  #2

1715222906
Report to moderator
1715222906
Hero Member
*
Offline Offline

Posts: 1715222906

View Profile Personal Message (Offline)

Ignore
1715222906
Reply with quote  #2

1715222906
Report to moderator
aliashraf
Legendary
*
Offline Offline

Activity: 1456
Merit: 1174

Always remember the cause!


View Profile WWW
April 24, 2019, 02:40:35 PM
Last edit: April 24, 2019, 02:54:25 PM by aliashraf
Merited by darosior (2), ABCbits (1)
 #2

I don't see anything wrong with these test vectors:
A12UEL5L
a12uel5l
an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharacter sbio1tt5tgs
?1ezyfcl
(empty data part, blue HRP, green checksum)

abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw
11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqc8247j
split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w
(red data part, blue HRP, green checksum)

Bech32 encoding is relaxed about padding, segwit address format requires padding when applicable, these test vectors are not segwit addresses, just some arbitrary bech32 encoded strings.



Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 24, 2019, 04:12:05 PM
 #3

Bech32 encoding is relaxed about padding,

That is the part missing from the bip...

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!