Author

Topic: Implementing OP_MUL with OP_ADD (Read 141 times)

legendary
Activity: 3472
Merit: 10611
February 06, 2020, 09:19:35 AM
#2
Quote
The result of a * b must fit into a signed 32-bit integer.
generally speaking result of all arithmetic operations can overflow that is why the result is always a 64-bit integer. the only rule is that the value that is popped to be evaluated as an integer can not be bigger than 32-bit.

you should also add some explanation about your OP_MUL, it is not easy to figure out.
newbie
Activity: 20
Merit: 39
February 06, 2020, 05:58:56 AM
#1
For fun I implemented OP_MUL using OP_ADD. You can find the code here on Github.

Feedback very appreciated!

And I have a question: do you guys know any good source for advanced bitcoin scripts? Is there something like a library for scripts?
Jump to: