-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: Time-Locked Coinbase #280
Conversation
Function `arbitrary_with` still exists but has been renamed to `arbitrary_with_size_numbers`. New name describes purpose of arguments, which are not unambiguous otherwise. This change means that `PrimitiveWitness` does not any longer implement trait `ArbitraryWith`, which only makes sense if the arguments are unambiguous.
In the main code path for arbitrary instances of `PrimitiveWitness`, the `num_inputs` now has type `Option<usize>` so that it either counts the number of input UTXOs in the transaction, or else indicates that the generated `PrimitiveWitness` is one for a coinbase transaction (*i.e.*, one with a set coinbase amount). When a `PrimitiveWitness` for a coinbase transaction is generated then there are 2x as many output UTXOs and half of them are time-locked for 3 years.
1. Transaction is invalid if not enough coinbase funds are time-locked. 2. Transaction is invalid if time-lock does not extend far enough into the future.
The tokenomics of Neptune Cash stipulate that half of all mining be time-locked for three years. This commit time-locks half of the coinbase. Half of the guesser fee is already automatically time-locked. Specifically, this commit modifies the tasm code for consensus program `NativeCurrency` to verify that across all outputs (and counting half of the transaction fee), at least half of the coinbase is time-locked for three years. Co-authored-by: Thorkil Schmidiger <thor@neptune.cash>
Closes #276. Co-authored-by: Thorkil Schmidiger <thor@neptune.cash>
Co-authored-by: Thorkil Schmidiger <thor@neptune.cash>
Allow caller to specify proof quality of coinbase transaction. This change has the benefit of allowing tests that do need coinbase transactions but not necessarily with valid proofs. This closes #242. Co-authored-by: Thorkil Schmidiger <thor@neptune.cash>
Co-authored-by: Alan Szepieniec <alan@neptune.cash>
Co-authored-by: Alan Szepieniec <alan@neptune.cash>
No reason for these proofs to be deterministic; no proofs are being generated.
From `PrimitiveWitness`.
Use the error IDs to assert that the expected assert-instructions are hit in the various negative tests.
Multiple tests and test-case generators needed adjusting after adding timelocks to minimum 1/2 of the coinbase amount.
Can you describe (or link to a description) the purpose (game theory? security? economics? marketing?) of time-locking 50% for 3 years, and why those specific pararameters are chosen. thx. |
The dynamic we are hoping to engineer is to align the incentives of miners with the long-term success of the cryptocurrency. Miners have an interest in the price now as well as in the price three years from now, which is affected by the quality of the protocol at that time. In particular:
As for the particular parameters:
We did consider alternative parameters. We had the following considerations:
|
This branch has been extended (asz/negative-fees) and then merged into master. |
In Neptune Cash, the coinbase is divided into two parts. The first is liquid immediately; the second is locked for 3 years. This PR applies the latter lock.
Note that the guesser reward is already split in two parts, one liquid immediately and the other locked for 3 years. This commit modifies the
NativeCurrency
type script so as to require that if the transaction has a coinbase, then half of it is locked -- however this amount is distributed across time-locked outputs and guesser fee.