Here are some other math operations that we could consider on top of ECADD and ECMUL.
| Opcode | Description | Benefit (vs. emulation) | Cost to Emulate in Script | Risk/Complexity | Notes & Recommendation |
|---|---|---|---|---|---|
| Basic Operations | |||||
| OP_ECADD | Point addition: given two secp256k1 points P, Q on the stack, pushes P+Q. | ≈ >1000× faster than doing field operations + curve math in script. | ~ 4000+ big‑int ops + looping (~200 K “unit” ops) | Moderate: must validate inputs lie on curve, constant‑time implementation. | Include: core building block for any EC work. |
| OP_ECMUL | Scalar multiplication: given a point P and scalar k, pushes k·P. | ≈ >10 000× faster than repeated doubling/add in script. | ~ 100× OP_ECADD via double‑and‑add loop (≈ 400 K “unit” ops) | Moderate: enforce 0<k<order, constant‑time ladder. | Include: required to do any signature‑style verification or covenant logic. |
| Highly Useful | |||||
| OP_MODINV | Modular inversion: given nonzero a in 𝔽ₚ, returns a⁻¹ mod p. | O(1) native vs. O(n²) exponentiation in script (≈ thousands of ops). | ~ 5000+ big‑int ops + loops | Must be constant‑time; must detect & reject a=0. | Recommend: needed for slope computation in ECADD/ECDOUBLE and other field work. |
| OP_ECMULTGEN | Generator mul: like OP_ECMUL(k, G), but 3× faster using precomputed G tables. | ≈ 3× faster than generic ECMUL when one operand is known generator G. | ≈ same cost as generic ECMUL in script | Same checks as ECMUL; uses fixed-window tables. | Strongly recommend if you plan any on‑chain Schnorr or MuSig verification. |
| Optional | |||||
| OP_ECDOUBLE | Point doubling: given a point P, pushes 2·P. | ≈ 30–50% speedup in windowed ECMUL or multi‑add loops vs. two ECADD. | N/A (would be 2× OP_ECADD) | Same as ECADD. | Optional: skip if you have ECMUL, but useful to speed up multi‑scalar routines. |
| OP_ECNEG | Point negation: given P=(x,y), pushes –P=(x,−y). | Native constant‑time negate vs. a handful of big‑int ops in script. | ~ 20 big‑int ops | Negligible. | Optional: very cheap to emulate; lowest priority. |
| High‑Risk / Specialized | |||||
| OP_DECOMPRESS | Point decompress: given 33‑byte compressed P, pushes full 65‑byte (x,y). | Saves 32 bytes per output + ~10× faster than script‑level sqrt. | Emulate via modular sqrt ≈ O(p^¼) exponentiation → millions of ops | Needs constant‑time sqrt, parity check, heavy code. | Use with care: big chain‑savings but very tricky and DoS‑sensitive. |
| OP_ECMULTMULTI | Multi‑scalar mult: given [kᵢ, Pᵢ] for i=1…n, pushes ∑kᵢ·Pᵢ sub‑linearly in n. | Sub‑linear speedup vs. doing n separate ECMULs in script. | ≥ n× generic ECMUL (linear) | Must cap n, fixed-window, careful memory use. | Only for very large batch ops (e.g. MuSig with many keys); otherwise too complex. |
| OP_PAIRING_CHECK | BN‑pairing: verify pairing equation e(P, Q)… for SNARKs/BLS.* | On‑chain SNARK/BLS proof with a single op vs. infeasible in script. | Impossible in script | Massive code size, DoS risk, consensus complexity. | Not recommended—far too heavy & risky for BCH today. |
For right now, it might be worth considering adding MODINV and ECMULTIGEN as these seem fairly useful without having cheap substitutes while still keeping to relatively safe computation. There are some like the one for on-chain SNARK/BLS proof, but I don’t think they are really needed for the near-term future until the tech gets a bit more mature

