Skip to content

Conversation

@aguycalled
Copy link
Collaborator

@aguycalled aguycalled commented Sep 3, 2025

This commit introduces a major refactoring of the transaction model to reference prevout's using transaction output hashes instead of pairs of transaction hashes and output indexes, along with new BLS signature opcodes for enhanced support of BLS signature verification inside of the scripting language.

The primary motivation for this change is to support transaction pre-generation and pre-signing in Navio's block aggregation model. Navio aggregates all transactions in a block into a single aggregated transaction during block construction. This aggregation process changes the transaction hash of the original transactions, which invalidates any pre-signed transactions that referenced outputs using the traditional (transaction hash, output index) format.

By using output hashes instead of transaction hash + output index pairs, transactions can now be:

  • Pre-generated: Created before the parent transaction is confirmed on the network
  • Pre-signed: Signed in advance without knowledge of the final transaction hash
  • Remain valid: Continue to be valid even after block aggregation changes the parent transaction's hash

This is because output hashes are derived from the output content itself (scriptPubKey, value, etc.) and remain static regardless of how the transaction is aggregated or what its final transaction hash becomes.

The introduction of the OP_BLSCHECKSIG op code, removes the reliance on the spendingKey parameter of the output for the creation of spending rules based on proving private key knowledge, therefor allowing the use of BLS Keys in complex spending paths like atomic swaps. The spendingKey of an output is allowed to be zero'ed, leaving all the spending flow to the script of the output. Following this logic, the following two outputs are meant to be spent under the same conditions:

Output1:

  • spendingKey: keyA
  • scriptPubKey: empty

Output2:

  • spendingKey: empty
  • scriptPubKey: keyA OP_BLSCHECKSIG

alex v added 30 commits September 3, 2025 20:17
…d clean up SegWit test code by eliminating redundant hash calculations.
…e redundant transaction ID assignment in SegWit test.
…0 and change worker type to 'noble'; add new COutPoint_old class and update transaction data in various test files for consistency.
… 'small' and 'medium'; modify mempool tests to use InsecureRand256 for predicate generation for improved randomness and consistency.
… randomness; update MineBlock function to return output hash instead of transaction hash
…ut management; update staking tests to validate minimum stake requirements and enhance verbose output handling in BLSCT wallet operations.
…ed transitions from the minimum difficulty limit; update consensus parameters for genesis block and improve wallet transaction handling by removing debug output and ensuring proper input selection. Additionally, modify tests to reflect changes in difficulty calculations and consensus limits.
…ove code cleanliness and maintain consistency across the codebase.
… RPC and wallet functions to reflect changes in output management and fix tests
… for predicate parsing in various components, ensuring robustness against invalid data. Update memory usage calculations in transaction management and fix test cases
…r skipping descendant limits during block updates; enhance the UpdateTransactionsFromBlock function to improve efficiency and maintain consistency in handling transaction states. Additionally, introduce a new RPC command to retrieve transactions by output hash, improving wallet functionality and fix tests
…tion to clear replaced_by_txid; enhance the create_tx method in BIP66Test for better output management; add new functional test for gettxfromoutputhash RPC command; update test runner to include the new test; adjust wallet_bumpfee tests for output validation and fee rate calculations.
…action retrieval; update send_to_witness calls in SegWitTest to use the new getutxo signature; enhance error handling in blocktools.py for transaction signing process.
…sistently formatted with zero-padding; refactor getutxo function to improve transaction retrieval; update output handling in ImportRescanTest for better transaction identification.
…d_vout_for_address with find_outid_for_address for improved output identification; update transaction retrieval methods to ensure consistency across functional tests.
…output hash identification; update GetTransactionAncestry to locate transactions via output hashes, enhancing consistency in ancestor calculations. Modify fee calculation logic in MiniMiner to only include ancestors needing fee bumps, improving efficiency. Additionally, update various tests to ensure compatibility with new output handling methods.
… 'gettxfromoutputhash'; remove 'vout' parameter from relevant RPC documentation and tests for improved clarity and consistency. Update wallet balance retrieval to account for wallet reuse avoidance. Refactor transaction input handling in tests to eliminate unnecessary 'vout' references, ensuring compatibility with recent changes.
…es in p2p_headers_sync_with_minchainwork.py, adjust byte count in p2p_ibd_stalling.py due to added predicate data, comment out test_chain_listunspent call in wallet_basic.py, and correct serialized transaction size assertion in invalid_txs.py.
This commit introduces the `GETOUTPUTDATA` message type, allowing peers to request transactions by output hash. It includes the implementation of `ProcessGetOutputData`, `FindTxByOutputHash`, and `AddOutputHashAnnouncement` methods in `PeerManagerImpl`. Additionally, a new class `COutputHashRequest` is defined for handling output hash requests. The changes also update the protocol definitions and enhance the message handling framework to accommodate this new functionality, ensuring compatibility with existing transaction processing logic.
…es instead of output points. Update related test cases to ensure consistency in transaction identification and improve clarity in output handling.
…istency. Simplify conditional statements and enhance code structure in AddToWallet and RecursiveUpdateTxState functions. Update error handling in Create method for better clarity on wallet loading issues.
aguycalled and others added 21 commits November 20, 2025 15:43
… Ensure BlockUntilSyncedToCurrentChain is called without holding cs_main lock in gettxfromoutputhash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants