Thomas Hartman [ARCHIVE] on Nostr: ๐ Original date posted:2020-08-19 ๐ Original message:> > So perhaps the way ...
๐
Original date posted:2020-08-19
๐ Original message:>
> So perhaps the way op_diff should work is take 2 packed targets, 1 known and 1 unknown at time of contract, and return the ratio.
On second thought, I donโt think this is a good idea. The 32-bit packed difficulty target is equivalent to difficulty, and this is probably what should get pushed onto the stack. No division is needed, just the arithmetic less than operator, which is already live in script, using the tick strategy described by Tier. So it seems to me these contracts could truly be done with the addition of the single op_diff opcode. Itโs probably less human readable to be using difficulty target instead of difficulty, but no one reads script anyway.
It was also bothering me that difficulty was a floating point number (I have floating point phobia), so it is great not to have to think about floats anymore!
๐ Original message:>
> So perhaps the way op_diff should work is take 2 packed targets, 1 known and 1 unknown at time of contract, and return the ratio.
On second thought, I donโt think this is a good idea. The 32-bit packed difficulty target is equivalent to difficulty, and this is probably what should get pushed onto the stack. No division is needed, just the arithmetic less than operator, which is already live in script, using the tick strategy described by Tier. So it seems to me these contracts could truly be done with the addition of the single op_diff opcode. Itโs probably less human readable to be using difficulty target instead of difficulty, but no one reads script anyway.
It was also bothering me that difficulty was a floating point number (I have floating point phobia), so it is great not to have to think about floats anymore!