From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 68DA2B65 for ; Mon, 8 May 2017 22:43:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 48BE61B5 for ; Mon, 8 May 2017 22:43:05 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id n4so62471577qte.2 for ; Mon, 08 May 2017 15:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=xJF/3dEaccJ3WqAE4uvIrq651xxUPtDLupPX1vJ1MLY=; b=FUphiRX9yVAA3vTWwMLcSPxS2axikuCG80O6SjwMkl0H3rHSAxtkXv2vLSjSVB9HGQ e7w5e61jwQJu2dL17iUKLO2LrtIpujLtcSMfD7HHc9OCokPgpkQZzO/kzGi1YzsEgkda CG1RnkJhsMJgYTZvYz7lf6e+AjRb/2dxpKoCcZoeTyKAgWU+ioy0iSWcrzgHouLP2iWW ODsV8OT4axnqPjqH7ABipTq/+rbVuO2JT9gXPc5RAMuo7jSz1pTYAXGDGJrWp3pPnKKU nsJO/vq/qOMtx9GYHSFYeZ2q0DXxRGhbKEkdRsexl8G7Ciq5QSJ8GiUP4wqCIy2G3b1W fyZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=xJF/3dEaccJ3WqAE4uvIrq651xxUPtDLupPX1vJ1MLY=; b=tbrhimyJegfdtuZJIxaPHWNdWEs/43toGPVF9DpgkeocdM6Kl1tscpsuDf+jNtphrz irP/fkTwB9EvIHC+yMihhfh6fRHQyc7KGpYGc0YC3WJB0r8c50Wpqi6+eOFyb7Gi9aQx r071tAzXp+/Ya3hEGr3JwH1C6npz+3XrXMwSMz5Zd+nwK7/lE9ILqby/iuxO1td+KUZu CNrji3WQwT4JyeuJJh1YebUsbHLKiPj4Pbm+AqIikPqlb5ZrKcHyAc4r8E10jfgNrMKg ZUZdfPIu/VBWeUTVKkRxLZ45I6MUeKsWKMefgSG/xOaNPpv7xTwfmaD+8nwm0gjCs8gy /iGA== X-Gm-Message-State: AN3rC/7AJ0XSV06jQdhglgQxnP7aDcw5BQabWesEHVIDcFf0fkFBshUd oAjbI/1zoygmLfFix/AobJ9j6M7q9bYiY8k= X-Received: by 10.200.47.73 with SMTP id k9mr20235202qta.11.1494283384252; Mon, 08 May 2017 15:43:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.165.132 with HTTP; Mon, 8 May 2017 15:42:23 -0700 (PDT) From: Sergio Demian Lerner Date: Mon, 8 May 2017 19:42:23 -0300 Message-ID: To: bitcoin-dev Content-Type: multipart/alternative; boundary=001a114670904fed79054f0af6e8 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: hello@p2sh.info Subject: [bitcoin-dev] Some real-world results about the current Segwit Discount X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 22:43:06 -0000 --001a114670904fed79054f0af6e8 Content-Type: text/plain; charset=UTF-8 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. --001a114670904fed79054f0af6e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have processed 1000 blocks starting from=C2=A0Block #461= 653.

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

This takes into account that ot= her types of transactions will not be modified by Segwit (e.g. OP_RETURN ou= tputs, or P2PK). This analysis doesn't take into account that LN transa= ctions may affect the current state, =C2=A0increasing the segwit/nosegwit r= atio.

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

acMainChainS= pace =3D352608924
acSegwitSpace =3D599400403
Ratio segw= it/nosegwit=3D1.6999

This implies that the 7= 5% 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-o= f-4-why-not-2-or-8-bbcebe91721e.

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

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




=

--001a114670904fed79054f0af6e8--