Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Currently OP MOD is considered nonstandard in the Bitcoin protocol, but we can for example combine OP SHA1 and OP GREATERTHAN to gain a similar effect.
https://www.cs.technion.ac.il/~idddo/cointossBitcoin.pdf
How can we combine OP_SHA1 and OP_GREATERTHAN to calculate modulus? Or in other words, how can we do the following things using bitcoin scripting:
Calculate
a
modb
with counterc
Start with counter 0, keep adding 1 and stop if OP_GREATERTHAN for
b
andc
returns zero.Write counter increments
a
times in clockwise order and modulus is last number.Example: 8 mod 4 will result in 1 2 3 0 1 2 3 0 which is zero.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments