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
Libbitcoin models the script execution stack as a stack of variants (each element is either a int64_t, bool or chunk_xptr). For some operations, the various types need to be converted so that e.g. the elements can be compared.
The conversion of a boolean to a byte array (data_chunk) is currently implemented incorrectly. false is encoded as {0} and true is encoded as {1}:
diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json
index 70df0d0f69..0aeaaeec45 100644
--- a/src/test/data/tx_valid.json+++ b/src/test/data/tx_valid.json@@ -5,6 +5,9 @@
["serializedTransaction, excluded verifyFlags]"],
["Objects that are only a single string (like this one) are ignored"],
+["Boolean encoding"],+[[["0000000000000000000000000000000000000000000000000000000000000000", 0, "0 1 EQUAL SIZE 0 EQUAL"]], "020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "STRICTENC,LOW_S,SIGPUSHONLY,MINIMALDATA,DISCOURAGE_UPGRADABLE_NOPS,CLEANSTACK,MINIMALIF,NULLFAIL,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,WITNESS_PUBKEYTYPE,CONST_SCRIPTCODE,TAPROOT,DISCOURAGE_UPGRADABLE_PUBKEYTYPE,DISCOURAGE_OP_SUCCESS,DISCOURAGE_UPGRADABLE_TAPROOT_VERSION"],+
["The following is 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
["It is of particular interest because it contains an invalidly-encoded signature which OpenSSL accepts"],
["See http://r6.ca/blog/20111119T211504Z.html"],
The text was updated successfully, but these errors were encountered:
Libbitcoin models the script execution stack as a stack of variants (each element is either a
int64_t
,bool
orchunk_xptr
). For some operations, the various types need to be converted so that e.g. the elements can be compared.The conversion of a boolean to a byte array (
data_chunk
) is currently implemented incorrectly.false
is encoded as{0}
andtrue
is encoded as{1}
:libbitcoin-system/include/bitcoin/system/impl/machine/number.ipp
Lines 115 to 118 in 2d57336
According to the reference implementation,
false
is encoded as{}
(empty byte array).This difference can be demonstrated by the following test case:
libbitcoin test case
Bitcoin Core test case
The text was updated successfully, but these errors were encountered: