Bitcoin Forum
February 29, 2020, 07:56:34 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Implementing OP_MUL with OP_ADD  (Read 46 times)
RobinLinus
Newbie
*
Offline Offline

Activity: 5
Merit: 14


View Profile
February 06, 2020, 10:58:56 AM
Last edit: February 06, 2020, 11:09:44 AM by RobinLinus
 #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?
1582962994
Hero Member
*
Offline Offline

Posts: 1582962994

View Profile Personal Message (Offline)

Ignore
1582962994
Reply with quote  #2

1582962994
Report to moderator
1582962994
Hero Member
*
Offline Offline

Posts: 1582962994

View Profile Personal Message (Offline)

Ignore
1582962994
Reply with quote  #2

1582962994
Report to moderator
AWARD-WINNING
CRYPTO CASINO
ASKGAMBLERS
PLAYERS CHOICE 2019
PROUD
PARTNER OF
1500+
GAMES
2 MIN
CASH-OUTS
24/7
SUPPORT
100s OF
FREE SPINS
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1582962994
Hero Member
*
Offline Offline

Posts: 1582962994

View Profile Personal Message (Offline)

Ignore
1582962994
Reply with quote  #2

1582962994
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 1932
Merit: 2391


Remember tonight for it's the beginning of forever


View Profile
February 06, 2020, 02:19:35 PM
 #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.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!