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!
Published at
2023-06-07 18:26:35Event JSON
{
"id": "22e96f33e9ea463942e01c8e2d2b0f24c1c9e1531b75d19d4e45ab2f3660d57f",
"pubkey": "4a77fd25d5100aa2400ecd7ad6bab548f8837fad6a93bcfc6c80e6ae33645e49",
"created_at": 1686162395,
"kind": 1,
"tags": [
[
"e",
"d975d0e94c587e8c2426d51dc6f0148b03b8ba3d81a52dbc71cd479a2959485f",
"",
"root"
],
[
"e",
"bb703f6da223f6c11b1d8b7f2800da61aa777bf3cf1485277ff70c954cef5644",
"",
"reply"
],
[
"p",
"4a77fd25d5100aa2400ecd7ad6bab548f8837fad6a93bcfc6c80e6ae33645e49"
]
],
"content": "๐
Original date posted:2020-08-19\n๐ Original message:\u003e \n\u003e 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. \n\nOn 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. \n\nIt 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!",
"sig": "5ee4b67b834a6b6eeb31f4fffd70fd0c8722e4ef83c7f5bdd3e1c7d3f123a0a87e8264ba8cc7af91f72b778db44fc5fd699f480be5d979b2cd8dd6ad8168f4d1"
}