<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">yes, log2work is already computed and would be a strictly increasing value, like time. Thank you for this suggestion. I think attempting an implementation will give further clues it this more suitable to express the same.</div><div class=""><br class=""></div><div class="">Tamas Blummer</div><br class=""><div><blockquote type="cite" class=""><div class="">On May 24, 2019, at 10:36, Natanael &lt;<a href="mailto:natanael.l@gmail.com" class="">natanael.l@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Thu, May 23, 2019 at 9:58 PM Pieter Wuille via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If the difficulty can be directly observed by the script language, you<br class="">
would need to re-evaluate all scripts in unconfirmed transactions<br class="">
whenever the difficulty changes. This complicates implementation of<br class="">
mempools, but it also makes reasoning about validity of (chains of)<br class="">
unconfirmed transactions harder, as an unconfirmed predecessor may<br class="">
have conditions that change over time.</blockquote><div class=""><br class=""></div><div class="">To deal with potentially wildly varying difficulty, could the value exposed be the sum of accumulated PoW, or in other words the sum of each block's difficulty value in the entire chain? This should be a value that will only rise unless a reorg happens after a difficulty drop happens (only likely to be the result of users manually blacklisting an otherwise valid block that is several blocks back in the chain).</div><div class=""><br class=""></div><div class="">This mimics the effect of the block number which only grows. So if you're starting at time A with difficulty X, then you'd estimate what you think the accumulated PoW ought to be at time B with expected difficulty Y (as compared to the current value at time A), and put that value into the script.</div></div></div>
</div></blockquote></div><br class=""></body></html>