Thomas Hartman [ARCHIVE] on Nostr: 📅 Original date posted:2020-08-19 📝 Original message:> On Aug 16, 2020, at 2:59 ...
📅 Original date posted:2020-08-19
📝 Original message:> On Aug 16, 2020, at 2:59 PM, Tier Nolan via bitcoin-dev <bitcoin-dev at lists.linuxfoundation.org> wrote:
>
> Output 0: Pay Alice if diff < 1.00 trillion else Bob
What is included in blocks is a packed representation of the difficulty target, not the difficulty per se as typically reported on blockchain explorer.
https://en.bitcoin.it/wiki/Difficulty <
https://en.bitcoin.it/wiki/Difficulty>
Perhaps what is best for speculation contracts is not the difficulty per se, but the ratio between some unknown future difficulty and the current difficulty. That is easily obtained from the packed representations already included in blocks. IE
Current difficulty / last difficulty = 1 / ( current target / last target )
To give a worked example, current difficulty is 16.94T, and last difficulty was 16.84T.
Current packed target is 0x17109bac, last packed target is 0x1710b4f8
16.94 / 16.84 is same as 1 / ( 0x109ba / 0x10b4f8 ) (the 17 is an exponent in both cases so leaving it out for clarity).
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.
The contract could then work as previously described, except using the ratio for ticks instead of the difficulty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200819/4a4b1a9f/attachment.html>
Published at
2023-06-07 18:26:35Event JSON
{
"id": "bb703f6da223f6c11b1d8b7f2800da61aa777bf3cf1485277ff70c954cef5644",
"pubkey": "4a77fd25d5100aa2400ecd7ad6bab548f8837fad6a93bcfc6c80e6ae33645e49",
"created_at": 1686162395,
"kind": 1,
"tags": [
[
"e",
"d975d0e94c587e8c2426d51dc6f0148b03b8ba3d81a52dbc71cd479a2959485f",
"",
"root"
],
[
"e",
"a3ab26d0681c69346610d012ceb6bc77b24edc9fedc0a4799db9493af1a558ca",
"",
"reply"
],
[
"p",
"46986f86b97cc97829a031b03209644d134b939d0163375467f0b1363e0d875e"
]
],
"content": "📅 Original date posted:2020-08-19\n📝 Original message:\u003e On Aug 16, 2020, at 2:59 PM, Tier Nolan via bitcoin-dev \u003cbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\u003e \n\u003e Output 0: Pay Alice if diff \u003c 1.00 trillion else Bob\n\nWhat is included in blocks is a packed representation of the difficulty target, not the difficulty per se as typically reported on blockchain explorer. \n\nhttps://en.bitcoin.it/wiki/Difficulty \u003chttps://en.bitcoin.it/wiki/Difficulty\u003e\n\nPerhaps what is best for speculation contracts is not the difficulty per se, but the ratio between some unknown future difficulty and the current difficulty. That is easily obtained from the packed representations already included in blocks. IE\n\nCurrent difficulty / last difficulty = 1 / ( current target / last target )\n\nTo give a worked example, current difficulty is 16.94T, and last difficulty was 16.84T. \nCurrent packed target is 0x17109bac, last packed target is 0x1710b4f8\t\n16.94 / 16.84 is same as 1 / ( 0x109ba / 0x10b4f8 ) (the 17 is an exponent in both cases so leaving it out for clarity). \n\nSo 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\nThe contract could then work as previously described, except using the ratio for ticks instead of the difficulty.\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200819/4a4b1a9f/attachment.html\u003e",
"sig": "b33cc2aea464b0e900ab4a8427f58f8396f1e114eb143500230908d009d7f14e8e76af406150fe585ce22b1852cd7a35cf576ea51f7029316ef0ffcdf44dea1d"
}