CHIP 2023-07 Composite Arithmetic Opcodes

Made some small changes to the composite-arithmetic-opcodes CHIP (v1.2.0)

@bitcoincashautist explained how the implementation of using two 32-bit integers to represent a VM integer means you can only represent 63-bit integers and emulate up-to 125-bit integer math - and not in fact 64-bit integers and 127-bit math like it said before. There were some other small fixes in emulatedOpcodes.cash.

I think work on this cashscript math libraries will pay off when we get re-targgeted VM limits so contract authors can actually use them in their smart contracts.

By looking more into math in the solidity ecosystem it is clear emulating muldiv is quite foundational:
Math in Solidity (Part 3: Percents and Proportions)

2 Likes

This CHIP to add ‘Composite Arithmetic Opcodes’ to Bitcoin Cash has now been withdrawn in favor of the more general solution coming to Bitcoin Cash on May 15th 2025 with CHIP 2024-07 BigInt: High-Precision Arithmetic for Bitcoin Cash .

The CHIP served as a useful exercise in exploring the possible solution space, and I am glad that the BigInts proposal will address the same pain-points which were highlighted in this proposal.

Thanks you to everyone who spent time thinking about and giving feedback on the proposal! :pray:

4 Likes