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

The value provided by a ZKAP is less than its nominal value #218

Open
exarkun opened this issue Aug 13, 2021 · 2 comments
Open

The value provided by a ZKAP is less than its nominal value #218

exarkun opened this issue Aug 13, 2021 · 2 comments

Comments

@exarkun
Copy link
Collaborator

exarkun commented Aug 13, 2021

ZKAPAuthorizer can be configured (on client and server, though both sides must agree to interoperate) with the bytes component of the value of a ZKAP. The time component is always 31 days. Call the bytes component B.

A ZKAP can be used to renew a lease or allocate a bucket (implicitly taking a lease on the shares placed in it). The lease is good for 31 days and for a data size of S, ceil(S / B) ZKAPs must be spent to obtain the lease. In other words, fractional spending is not allowed and the cost of a lease is the rounded-up cost.

This means that any data that is stored that is not an exact multiple of B results in some of the value of a ZKAP being thrown away. Since most data will not be a multiple of B in size, this means that most lease-obtaining operations end up wasting some value. For small files, this is particularly disruptive of the intended system. Imagine B is set to 1,000,000 (ie, one megabyte). It should not cost the same to store ten bytes of data as to store 1 MB, nor should it cost 100,000 times more to store 100,000 ten byte data objects than it costs to store one 1 MB data object.

@tomprince
Copy link
Contributor

One way we could potentially handle this is if a ZKAP is worth 31 mb*days, but let how that breaks down into time vs size vary. So, redeeming a ZKAP for a 100KB file would then get a lease for 310 days. In some ways, this isn't ideal for our use case, as the user may not want to keep that file for that long, though.

@exarkun
Copy link
Collaborator Author

exarkun commented Aug 18, 2021

One way we could potentially handle this is if a ZKAP is worth 31 mb*days, but let how that breaks down into time vs size vary. So, redeeming a ZKAP for a 100KB file would then get a lease for 310 days. In some ways, this isn't ideal for our use case, as the user may not want to keep that file for that long, though.

I tend to like this solution, at least for some areas of the problem space. It is true that offering many many years of storage for a small file is perhaps not the most useful outcome for users though. Some other ideas have been discussed (and documented ... somewhere) such as adjusting the protocol to allow for a group of files to be paid for all at once (so uploading 10 100 KB files would be charged 1 ZKAP, just as if you were uploading 1 1000 KB file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants