What is Nostr?
Thomas Hartman [ARCHIVE] /
npub1ffmโ€ฆ9z9w
2023-06-07 18:26:35

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!
Author Public Key
npub1ffml6fw4zq92ysqwe4addw44frugxladd2fmelrvsrn2uvmyteyswn9z9w