Bitcoin Forum
September 30, 2025, 08:02:21 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Why OP_CAT is disabled and why OP_ADD is only a 32-bit op? on: January 28, 2015, 09:12:34 AM
(1) Can anyone explain why the OP_CAT operation is disabled?


(2) Alternatively, can anyone explain why the OP_ADD (and other numeric operations) are 32-bit operations that throw an exception if the stack has a number that is larger than 32 bits?

https://github.com/libbitcoin/libbitcoin/blob/master/src/math/script_number.cpp#L91-L97

bool script_number::set_data(const data_chunk& data)
{
    if (data.size() > max_script_number_size)
        return false;
    value_ = script_number_deserialize(data);
    return true;
}

I ask because I would like to "mix" two values that are on the stack (eg. two hashes) and then take a hash of the result.  The mixing can be accomplished with either a string concatenate or an addition operation.  Any insight would be appreciated; if there are no serious reasons, I would like to consider drafting a BIP to change the behavior of one of the two operations (the most palatable one).

Thanks!

abhi
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!