public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Sergio Demian Lerner <sergio.d.lerner@gmail.com>
To: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
Cc: hello@p2sh.info
Subject: [bitcoin-dev] Some real-world results about the current Segwit Discount
Date: Mon, 8 May 2017 19:42:23 -0300	[thread overview]
Message-ID: <CAKzdR-qojNn8OtUTPbxa0JauK9nmo2ZGm4ihKuyzsz_FAgokDw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

I have processed 1000 blocks starting from Block #461653.

I computed several metrics, including the supposed size of witness data and
non-witness data (onchain), assuming all P2SH inputs/outputs are converted
to P2PWSH and all P2PKH inputs/outputs are converted to P2WPKH.

This takes into account that other types of transactions will not be
modified by Segwit (e.g. OP_RETURN outputs, or P2PK). This analysis doesn't
take into account that LN transactions may affect the current state,
 increasing the segwit/nosegwit ratio.

Among a lot of information, I've got the following real world results...

acMainChainSpace =352608924
acSegwitSpace =599400403
Ratio segwit/nosegwit=1.6999

This implies that the 75% that discount is not the best option to prevent
witness spam in a block of 4 MB, as stated in
https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbcebe91721e.

The non-witness data weight factor should not be 4 but 2.35. The closest
integer value is 2, which leads to a 50% witness discount.

The Bitcoinj source code is available for anyone to review. I encourage
anyone to re-compute this with another utility to cross-check. Maybe
Antoine Le Calvez (p2sh.info) would like to double-check.

[-- Attachment #2: Type: text/html, Size: 1655 bytes --]

             reply	other threads:[~2017-05-08 22:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 22:42 Sergio Demian Lerner [this message]
2017-05-08 23:47 ` [bitcoin-dev] Some real-world results about the current Segwit Discount Alphonse Pace
2017-05-09 13:49   ` Sergio Demian Lerner
2017-05-09 14:33     ` James Hilliard
2017-05-09 15:45     ` Johnson Lau
2017-05-09 16:19       ` Sergio Demian Lerner
2017-05-09 16:27         ` Johnson Lau
2017-05-09 16:27         ` James Hilliard
2017-05-09 18:15     ` Matt Corallo
2017-05-09 18:58       ` Sergio Demian Lerner
2017-05-09 19:15         ` Sergio Demian Lerner
2017-05-09 19:30           ` Gregory Maxwell
2017-05-09 19:42             ` Matt Corallo
2017-05-09 20:13               ` Gregory Maxwell
2017-05-09 20:58                 ` Sergio Demian Lerner
2017-05-10  5:37                   ` Jorge Timón
2017-05-10 14:05                   ` Matt Corallo
2017-05-10 15:25                     ` Sergio Demian Lerner
2017-05-10 16:39                       ` Matt Corallo
2017-05-10 19:40                         ` Sergio Demian Lerner
2017-05-08 23:56 ` Gregory Maxwell

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=CAKzdR-qojNn8OtUTPbxa0JauK9nmo2ZGm4ihKuyzsz_FAgokDw@mail.gmail.com \
    --to=sergio.d.lerner@gmail.com \
    --cc=bitcoin-dev@lists.linuxfoundation.org \
    --cc=hello@p2sh.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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