Author

Topic: Translation of Blockweight in Blocksize (Read 456 times)

sr. member
Activity: 377
Merit: 282
Finis coronat opus
June 12, 2017, 05: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.
sr. member
Activity: 409
Merit: 286
June 12, 2017, 02: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
Jump to: