Changes for the Genesis Upgrade
by Aleksander Gora
January 15, 2020 (5min read)
The Bitcoin SV Node team has released version 1.0.0 of the Bitcoin SV Node implementation. This version implements the updates required to support the Genesis hard fork upgrade which is scheduled to...

The Bitcoin SV Node team has released version 1.0.0 of the Bitcoin SV Node implementation. This version implements the updates required to support the Genesis hard fork upgrade which is scheduled to activate on February 4, 2020. The specification for the updates to the Bitcoin and Consensus rules is available here.

It is important to note that all installations of Bitcoin SV Node implementation must be upgraded to this release by February 4, 2020. Prior versions of the Bitcoin SV node software are incompatible with the updated rules and will fail after February 4.

Highlighted Changes

Mandatory Consensus Parameters

Mandatory consensus parameters must be configured by the system administrator. The software will terminate immediately if these parameters are not configured. More information about the mandatory consensus parameters is available on the bitcoinsv.io website.

Hard limit on the block size

The hard limit on the block size is a configuration parameter that specifies the maximum size that a block can be in order for it to be validated by the software. Blocks that are larger than this maximum will not be retrieved by the software or validated.

Maximum Stack Memory Usage During Script Evaluation

This mandatory consensus parameter defines the maximum amount of memory that can be used on the stack by a script during evaluation. If a script attempts to use more stack memory than defined in this consensus parameter, then the evaluation of the script will be terminated and the script fails.

Consensus Changes

Restore the functionality of OP_RETURN

This change restores the function of OP_RETURN to its original design, enabling Script developers to terminate Scripts early and easily, with the possibility of the result of executing the script being valid.

Change the script numeric type from 32 bit numbers to big numbers

This change will dramatically increase the mathematical capabilities of the Bitcoin Script language. 32-bit numbers are very limited in size which makes it very complicated and inefficient to do complex mathematical operations such as signature verification. This change will restore the original design, enhancing the efficiency of complex mathematical operations and enable complex Scripts that provide all kinds of advanced functionality.

Sunset P2SH for new transactions

Pay-to-script-hash (or P2SH) is a mechanism introduced to Bitcoin to enable hiding of output scripts at the time they are created.  This is counter to the philosophy of Bitcoin as an honest record of events. Additionally, P2SH use has encouraged wide use of poor privacy practices and divergence from the peer 2 peer workflow practices that are integral to the scaling proposition of Bitcoin. Existing P2SH coins will be unaffected so there is no need to sweep old wallets.  This change prevents any new P2SH outputs from being made.

Restore Satoshi style handling of nLockTime & nSequence

These two data fields are integral to the mechanism of payment channels that Satoshi describes as a fundamental mechanism for allowing high speed micropayments on Bitcoin.  They have been since repurposed by BTC Core developers for two new op codes. Along with removing those op codes the original usage of nLockTime and nSequence are being restored.

Other Required Change

P2P Relay of transactions with complex scripts

This change will enable the use of complex transactions by all participants of the network. Prior to Genesis, only transactions that were of a standard type, such as payment transactions or plain data transactions, would be distributed across the peer-to-peer network and therefore reach a miner. This meant that if a participant needed to use complex transactions, they would have to find a miner and reach an agreement to confirm the transactions in a block. After Genesis, all transaction types will be relayed across the peer-to-peer network, enabling anyone to use complex transaction types.

Additional Consensus Changes

  • Genesis Upgrade block height activation mechanism
  • UTXO age dependent rules
  • Formal Script Grammar
  • scriptSig can only contain OP_PUSHDATA operations
  • Sunset OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY for new transactions
  • Add a policy limit on max_script_memory_usage with a default of 100MB
  • Add a consensus limit on max_script_memory_usage
  • Remove the consensus limit on the number of signature operations per MB of block space
  • Remove the consensus limit on the maximum number of signature operations per transaction
  • Remove the consensus limit on the number of op codes per script
  • Remove the consensus limit on the maximum script element size
  • Remove the consensus limit on the maximum number of elements in a script
  • Remove the consensus limit on the maximum number of public keys per multisig
  • Increase the consensus limit on the maximum transaction size to 1GB.

Software Enhancements

  • Parallel Block Validation
  • Separate processing of non-standard transactions in low priority queue
  • Set script evaluation timeout policies for standard and non-standard transactions
  • Tx should be included in inv messages in the order in which they are validated
  • Enhance tests for Parallel Block Validation.
  • Common Genesis activation code and command line option.
  • Enable validation of non-standard txns (on MainNet) when Genesis is enabled.
  • Set mempool default = 1Gb.
  • Remove block size from user agent string.
  • Change default tx fees (default txfee = 0.5 sat/byte, default minrelaytxfee = 0.25 sat/byte)
  • Update SPV bloom filters re attack mitigation.
  • Improve performance of prevector deserialization.
  • Change logging messages to be more precise.
  • Fix: Validating non-standard transactions can lock up a node for more than a minute.
  • Fix: Tx validation uses original reject message and ban score is used
  • Fix block send queue overflow
  • Fix undefined behaviour in bsv::deserialize
  • Fix bitcoin-cli help getblock
  • Fix build: Configure should fail when it can’t detect boost
  • Set the execute bit on all the new Genesis functional tests.
  • Fix MedianTimePast
  • Fix: Nonfinal transactions with no inputs is rejected with incorrect reason
  • Fix memory leak in asn1_integer
  • Fix boost::optional warnings
  • Fix: hexhdr.py does not get included in packaged source
  • Fix: Fundrawtransaction RPC changePosition parameter causing out of bounds access
  • Add basic –enable-tcmalloc option to the build
  • Fix: CTxnDoubleSpendDetector deletion past end of vector
  • fix lshift and rshift on data larger than 2GB
  • Update to the RDP in preparation for Genesis
  • set max duration for async validation tasks
Release Notes