Goal and Scope
This document outlines a framework for evaluating potential consensus changes to Bitcoin Cash’s Script system. It presents an approach for Script upgrades and discusses specific proposals within the context of Bitcoin Cash’s broader roadmap.
Scope: Focuses on incremental Script improvements. Overarching proposals (e.g., new transaction formats like MITRA) fall outside this scope.
Approach
Bitcoin Cash aims to be peer-to-peer electronic cash accessible globally. Script enhances this by enabling flexible spending conditions, ensuring BCH functions as efficient electronic cash.
Criteria for Script Upgrades:
- Addresses gaps or complements existing Script features.
- Considers interactions with current/future Script components.
- Prioritizes generic, simple operators (avoid overly specific opcodes).
- Supports use-cases advancing BCH’s electronic cash goal.
- Minimizes risks (e.g., resource exhaustion, attack vectors).
Proposed Upgrades
1. Bigger Integers
- Description: Expand 32-bit integer limits to 64/128 bits for arithmetic operations.
- Status: Under discussion. Consensus favors the idea, but implementation requires detailed planning.
- Use-Cases: Simplifies handling transaction "amount" fields.
- Concerns: Overflow behavior must align with future arithmetic opcodes (e.g.,
OP_MUL).
2. OP_MUL
- Description: Re-enable multiplication (currently disabled).
- Status: Discussed; activated on BSV but lacks momentum in BCH.
- Use-Cases: Useful for price calculations in covenants.
- Concerns: Overflow behavior must accommodate potential integer size increases.
3. OP_REVERSEBYTES
- Description: Reverse byte order (e.g., convert big-endian to little-endian).
- Status: Draft spec proposed; implementation in progress.
- Use-Cases: Streamlines SLP "amount" field handling; simplifies txid manipulation.
- Concerns: Limited use-cases beyond SLP.
4. OP_PUSHSTATE
- Description: Push sighash preimage data to the stack for covenants.
- Status: Preliminary draft spec under heavy discussion.
- Use-Cases: Enables efficient covenant designs; emulates "Sighash NoInput."
- Concerns: Early-stage proposal; subject to change.
5. Reverse OP_ROLL
- Description: Insert top stack elements at arbitrary depths (aids high-level language compilation).
- Status: Discussion phase.
- Use-Cases: Improves efficiency for compiled Script.
- Concerns: Implementation options (e.g., negative
OP_ROLLinputs).
6. Registers
- Description: Add register-based opcodes (supplementing the stack).
- Status: Very preliminary discussion.
- Use-Cases: Enhances higher-level language support.
- Concerns: May complicate Script’s stack-based design.
7. Increase Script Limits
- Description: Raise script size/opcode limits for complex scripts.
- Status: Discussion phase.
- Use-Cases: Supports advanced scripts (e.g., compiled from high-level languages).
- Concerns: Requires careful evaluation to mitigate attack risks.
FAQ
Q1: Why focus on incremental Script upgrades?
A: Incremental changes minimize disruption while addressing immediate needs, ensuring backward compatibility.
Q2: How does OP_PUSHSTATE improve covenants?
A: It replaces inefficient sighash pre-image tricks with direct data access, reducing script complexity.
Q3: Are bigger integers a priority?
A: Yes, but implementation must carefully address overflow behavior and interactions with other opcodes.
Q4: What’s the next step for OP_REVERSEBYTES?
A: Awaiting community feedback and finalization of the draft specification.
👉 Explore Bitcoin Cash’s latest upgrades for deeper insights into Script enhancements.
Acknowledgements: Thanks to Mark Lundeberg and Amaury Séchet for their feedback.
### Key SEO Keywords:
- Bitcoin Cash Script
- BCH Script upgrades
- `OP_MUL`
- `OP_REVERSEBYTES`
- `OP_PUSHSTATE`
- Covenants