Bitcoin Forum
June 29, 2024, 01:36:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Translation of Blockweight in Blocksize  (Read 441 times)
Bergmann_Christoph (OP)
Sr. Member
****
Offline Offline

Activity: 409
Merit: 286


View Profile WWW
June 12, 2017, 07:00:49 PM
 #1

Hei everybody.

I tried to translate the blockweight formula 4*non-SW-data + 1*SW-data into blocksize to determine what capacity SegWit will give at which adoption and with what share of signatures in data. I did not find anything like this, so I tried to write a short javascript to simulate capacity with SegWit. Variables are m = SegWit adoption and n = percentage of Signatures in transaction space.

I'm neither a man of math nor code, so plz don't crucify me if there is something wrong. Since I wrote it I'm asking at several places for feedback, but nobody gave it until now. Maybe you can help me?

Here's the "simulator". The code should be easily understandable for everybody who has ever written a line of code in any language.

http://js.do/code/156684

--
Mein Buch: Bitcoin-Buch.org
Bester Bitcoin-Marktplatz in der Eurozone: Bitcoin.de
Bestes Bitcoin-Blog im deutschsprachigen Raum: bitcoinblog.de

Tips dafür, dass ich den Blocksize-Thread mit Niveau und Unterhaltung fülle und Fehlinformationen bekämpfe:
Bitcoin: 1BesenPtt5g9YQYLqYZrGcsT3YxvDfH239
Ethereum: XE14EB5SRHKPBQD7L3JLRXJSZEII55P1E8C
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
June 12, 2017, 10:26:35 PM
 #2

I'm neither a man of math nor code, so plz don't crucify me if there is something wrong. Since I wrote it I'm asking at several places for feedback, but nobody gave it until now. Maybe you can help me?


http://js.do/code/156684

Hello i don't like this lines:
Code:
var mbsw = 1000 * m * n;
var mbnsw = 1000 - mbsw + 0.1 * 1000 * m;
var mbbw = mbnsw * 4 + mbsw;
You created 2 excess variables (  mbsw and mbnsw) which don't affect on the result.
In fact it would be better to create two methods (first with cycle and calculations and second with text data)

Also, Segwitt don't create 4 mb blocks as i know. blocks still the same.

In science we trust!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!