public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Luke Dashjr <luke@dashjr•org>
To: Cory Fields <lists@coryfields•com>
Cc: Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] SegWit GBT updates
Date: Mon, 1 Feb 2016 19:46:23 +0000	[thread overview]
Message-ID: <201602011946.24405.luke@dashjr.org> (raw)
In-Reply-To: <CAApLimg+65PTn+=V_Es029j-Z-GJRCeMvO0aGdMrgTYFzJStvA@mail.gmail.com>

On Monday, February 01, 2016 6:41:06 PM Cory Fields wrote:
> Noticeably absent here is the "default_witness_commitment" key, as
> added by the current reference implementation[0].
> 
> I assume (please correct me if I'm wrong) that this has been omitted
> for the sake of having clients create the commitment themselves as
> opposed to having it provided to them.
> 
> I don't think that the two approaches (providing the default
> commitment for the complete tx set as well as the ability to create it
> from chosen transactions) are at odds with each-other, rather it
> merely allows for a simpler approach for those who are taking tx's
> as-is from bitcoind. It's obviously important for the clients to be
> able to chose tx's and create commitments as they desire, but it's
> equally important to allow for simpler use-cases.

Allowing for simpler cases both encourages the lazy case, and enables pools to 
require miners use it. It also complicates the server-side implementation 
somewhat, and could in some cases make it more vulnerable to DoS attacks. Keep 
in mind that GBT is not merely a bitcoind protocol, but is used between
pool<->miner as well... For now, it makes sense to leave 
"default_witness_commitment" as a bitcoind-specific extension to encourage 
adoption, but it seems better to leave it out of the standard protocol. Let me 
know if this makes sense or if I'm overlooking something.

> The issue in particular here is that a non-trivial burden is thrust
> upon mining software, increasing the odds of bugs in the process. 

It can always use libblkmaker to handle the "heavy lifting"... In any case, 
the calculation for the commitment isn't significantly more than what it must 
already do for the stripped merkle tree.

> I'd like to point out that this is not a theoretical argument. I've
> already fixed a handful of bugs relating to serialization or
> commitment creation in the mining/pool software that I've worked on
> for segwit [1][2][3][4].

That's not really fair IMO. I wrote the libblkmaker branch prior to even 
reading the SegWit BIPs or code, and without a way to test it. It's only to be 
expected there are bugs that get fixed in first-try testing.

> [4]:
> https://github.com/theuni/ckpool/commit/7d84b1d76b39591cc1c1ef495ebec513cb
> 19a08e

I'm pretty sure this commit is actually /introducing/ a bug in working (albeit 
ugly) code. The height, while always positive, is serialised as a signed 
number, so 0x80 needs to be two bytes: 80 00.

Luke


  reply	other threads:[~2016-02-01 19:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-30 18:50 Luke Dashjr
2016-02-01 18:41 ` Cory Fields
2016-02-01 19:46   ` Luke Dashjr [this message]
2016-02-01 21:43     ` Cory Fields
2016-02-01 23:08       ` Luke Dashjr
2016-02-02  1:40         ` Cory Fields
2016-02-02  2:30           ` Luke Dashjr

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=201602011946.24405.luke@dashjr.org \
    --to=luke@dashjr$(echo .)org \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    --cc=lists@coryfields$(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