Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cash vs MVP Criteria #33

Closed
kasima opened this issue May 14, 2018 · 7 comments
Projects

Comments

@kasima
Copy link
Member

@kasima kasima commented May 14, 2018

Document criteria for choosing to use Cash (+XT) vs MVP

@kasima kasima created this issue from a note in Plasma (In progress) May 14, 2018
@kfichter

This comment has been minimized.

Copy link
Collaborator

@kfichter kfichter commented May 15, 2018

Plasma MVP v. Plasma Cash Math

Corresponding spreadsheet here.

Plasma MVP

Bits per Tx

$$
\text{bits per tx} = (\text{bits per utxo} + \text{bits per amount} + \text{bits per address} + \text{bits per signature}) * 4
$$

$$
= (57 + 256 + 160 + 520) * 4 = 3972
$$

Bits per Block

$$
\text{bits per block} = \text{bits per tx} * \text{tx per block} = 3972 * \text{tx per block}
$$

Total Bits

$$
\text{total bits} = \text{bits per block} * \text{total blocks}
$$

Example

For 2^16 (65536) tx/block we have:

$$
\text{bits per block} = 3972 * 65536 = 260308992
$$

After 1 year, we have:

$$
\text{total bits} = 260308992 * 2103840 = 547648469729280
$$

Or ~68456 GB = ~68 TB per year.

Plasma Cash

Bits per Tx

Note: Proof size in bits decreases as the total number of watched coins increases because of caching at the higher tree levels.

$$
\text{bits per tx} = (\text{tx size in bits}) + (\text{proof size in bits})
$$

$$
= (\text{bits per coin ID} + \text{bits per address} + \text{bits per signature}) + (\text{merkle depth} * \text{bits per hash})
$$

$$
= (25 + 160 + 520) + (\log_{2}(\frac{\text{total coins}}{\text{coins per watcher}}) * 256)
$$

$$
= 705 + \log_{2}(\frac{\text{total coins}}{\text{coins per watcher}}) * 256
$$

Bits per Block

$$
\text{bits per block} = \text{bits per tx} * \text{coins per watcher}
$$

$$
= (705 + \log_{2}(\frac{\text{total coins}}{\text{coins per watcher}}) * 256) * \text{coins per watcher}
$$

Blocks per Checkpoint

$$
\text{blocks per checkpoint} = \frac{\text{total coins}}{\text{coins per checkpoint}}
$$

Total Bits

$$
\text{total bits} = \text{bits per block} * \text{blocks per checkpoint}
$$

Example

For 2^24 (16777216) total coins and 10000 coins per watcher we have:

$$
\text{bits per block} = (705 + \log_{2}(\frac{16777216}{10000}) * 256) * 10000 = 34473456
$$

$$
\text{total bits} = 34473456 * 2048 = 70601638520
$$

Or ~9 GB.

@kasima

This comment has been minimized.

Copy link
Member Author

@kasima kasima commented May 16, 2018

@DavidKnott @kfichter – is it possible to model out exit period growth as MVP scales?

@kfichter

This comment has been minimized.

Copy link
Collaborator

@kfichter kfichter commented May 16, 2018

@kasima Yes. I'm checking some gas costs right now and I'll get you a better model in a few.

@kfichter

This comment has been minimized.

Copy link
Collaborator

@kfichter kfichter commented May 16, 2018

So the gas cost of an exit is about ~80-90k gas, it's hard to get exact estimates w/o additional information. If we could somehow take up the entire block gas limit (~8m currently), then we'd get about 4m exits completed. Each exit would cost ~$0.30 @ current gas prices.

@kfichter

This comment has been minimized.

Copy link
Collaborator

@kfichter kfichter commented May 16, 2018

That's without challenges and whatever else. We can't assume that every block will be full, so it might be better to only assume 25% block usage ~= 1m exits. Of course that's if everyone instantly sees the block withholding and starts exiting right away. I don't think we'd actually get 1m exits submitted.

For reference, current BTC UTXO set is 50m.

@kfichter

This comment has been minimized.

Copy link
Collaborator

@kfichter kfichter commented May 16, 2018

In the best case we're probably getting 100 exits/block, likely closer to 10-25 in actuality. So as MVP scales, exit period time would have to scale linearly. I think mass exits are a must.

@kfichter kfichter removed their assignment Dec 28, 2018
boolafish added a commit that referenced this issue Mar 25, 2019
Move notes from issue: #33
@boolafish

This comment has been minimized.

Copy link
Contributor

@boolafish boolafish commented Mar 25, 2019

@boolafish boolafish closed this Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Plasma
  
In progress
3 participants
You can’t perform that action at this time.