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