tothemoon-org / extension-blocks

Extension blocks soft-fork specification
40 stars 6 forks source link

Witness discount #8

Open shesek opened 7 years ago

shesek commented 7 years ago

Can you please describe the motivation behind removing the witness discount? The misalignment of the UTXO creation incentives gets more and more problematic as the block size grows. Do you have an alternative solution for that?

chjj commented 7 years ago

The witness scale factor has been removed on the consensus layer, since it's not necessary for calculating DoS limits anymore.

That being said, policy is still up in the air. There will be a second document for "implementation commentary", discussing guidelines for policy.

As far as it's visualized now: Fees inside the ext. block are likely to be calculated by weighing the inputs/outputs cost against a fee rate. Since fee markets are essentially dictated by consensus limits, we can figure out figure out how the metrics will be weighed. Inputs and outputs cost may be weight differently, etc.

Policy is very secondary to finalizing the consensus layer as of right now though.

afk11 commented 7 years ago

The witness scale factor is policy; there's no way to detect if a miner hasn't offered a discount on witness data unless you look at the fee rate of the transactions being mined.

Any miner can say "I would like to be more competitive" and offer some discount on some data (as opposed to lowering their absolute fee rate).

I'd be very curious what you have to say about preventing this.

chjj commented 7 years ago

@afk11, no. Segwit's witness discount policy is a specific side effect of segwit's consensus rules. It's not arbitrary. Fee policy is greatly affected by the economic incentives that consensus rules create: if consensus DoS limits treat witness data as adding less weight, that will likely be taken into account on the policy layer.

Since extblk consensus rules regarding DoS limits weren't really solidified before, there was no way to tell whether a witness discount would be available or even make sense on the policy layer. Going by segwit-style weight makes little sense in terms of consensus rules for extblk, since the weight metric segwit uses is partly a hack to add more capacity to the main block. That metric isn't necessary for the extension block. All that said, extblk's inputs cost could be weighed against a lesser factor than outputs cost.

Any miner can say "I would like to be more competitive" and offer some discount on some data (as opposed to lowering their absolute fee rate).

Sure, a miner could do anything they wanted and mine 0 fee transactions right now if they want. It's a moot point. If that's the conclusion, then there's no sense in concerning ourselves with any of this. Luckily, that's not usually what happens. Transaction selection is only ever reasonably determined by fee rate weighed against DoS limits.

afk11 commented 7 years ago

Witness space is counted as 1/4 of the main space. Therefore, if you remove the discount (= charge more), then your available block space gets smaller. Removing the discount is safe, but it reduces the miners capacity.

afk11 commented 7 years ago

Like if you double counted sigOps while producing blocks (not validation), you'd lower the number of transactions you could mine in a block, but still be compatible with the network.

If you didn't count sigops, you'd make yourself incompatible.

Removing the discount is similar to the first, it's basically lowering your weight back to 1 million.