public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Thomas Hartman <thomashartman1@gmail•com>
To: Tier Nolan <tier.nolan@gmail•com>,
	Bitcoin Protocol Discussion
	<bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] reviving op_difficulty
Date: Wed, 19 Aug 2020 19:32:25 -0400	[thread overview]
Message-ID: <1EE02345-9A45-427F-AE13-6E96FD25B55E@gmail.com> (raw)
In-Reply-To: <C4A9F1FC-8BD9-4A03-806B-5091375090B5@gmail.com>

> 
> 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!



  reply	other threads:[~2020-08-19 23:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 15:41 Thomas Hartman
2020-08-16 18:59 ` Tier Nolan
2020-08-17  5:04   ` ZmnSCPxj
2020-08-17 19:48     ` Thomas Hartman
2020-08-17 23:14       ` ZmnSCPxj
2020-09-01 20:07         ` Thomas Hartman
2020-09-02 14:40           ` Thomas Hartman
2020-08-17 21:55     ` Tier Nolan
2020-08-19 21:15   ` Thomas Hartman
2020-08-19 23:32     ` Thomas Hartman [this message]
2020-08-16 22:29 ` Anthony Towns
2020-08-22 16:46 ` David A. Harding
2020-09-02 18:27   ` Jeremy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1EE02345-9A45-427F-AE13-6E96FD25B55E@gmail.com \
    --to=thomashartman1@gmail$(echo .)com \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    --cc=tier.nolan@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox