-
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 locks #107
Merged
Merged
feat: Time locks #107
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Avoid confusion with `neptune_coins`, which is for an amount of the native currency.
Both `native_currency` and `neptune_coin` belong in the new directory. Additionally, this directory anticipates a the new typescript, `time_lock`.
"Native coin" is now "native currency".
Also: add stub code for time lock type script. Hat-tip-to: Thorkil Værge <thor@neptune.cash>
With this support, we can write programs in rust such that they can be run natively or compiled first and then run in Triton VM.
Specifically: - Add dependencies for proptest - Move transaction primitive witness to a separate file - Rename the above to primitive witness - Implement arbitrary for a bunch of data structures, most importantly the primitive transaction witness
This commit: - defines a new data structure, `RootAndPaths` which holds a single Merkle root and a bunch of authentication paths - implements `proptest::Arbitrary` for `RootAndPaths`, enabling the user to supply the tree height and the leafs and leaf indices - defines a property test using `test_strategy` for `RootAndPaths` Co-authored-by: Ferdinand Sauer <ferdinand@neptune.cash>
Factoring out mutator set part of random witness generation.
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Co-authored-by: Thorkil Værge <thor@neptune.cash>
The generation of the input UTXOs (with witnesses) and output UTXOs (where we don't care about witnesses) for `arbitrary` from seeds and amounts has been moved to separate functions, enabling code reuse.
Co-authored-by: Thorkil Værge <thor@neptune.cash>
Witness objects such as `transaction::PrimitiveWitness` can contain lists of input and output UTXOs. This commit wraps these lists of into a new dedicated struct `SaltedUtxos` which adds a `salt` field. The purpose is such that consensus programs can reduce a claim about the set of input and/or output UTXOs to a claim about a single hash digest. The salt ensures that claims related to different transactions or blocks but happen to pertain to the same list of UTXOs (e.g., the empty list) reduce to claims about distinct digests.
Trait `SecretWitness` is the interface between a blob of data that makes an atomic unit of consensus logic valid, and the VM computation induced by that validity claim. As such it supports the generation of the program, the nondeterminism, and the input. The last one in that list is the new function declarations. Also in this commit: new trait `TypeScriptWitness` specializes `SecretWitness` because for all type scripts the input and output are the same. Specifically, the output is empty, and the input is the triple (transaction kernel mast hash, salted input utxos hash, salted output utxos hash).
This was referenced Feb 26, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces time locks, which are a type of type script that can lock a UTXO until a certain release date. UTXOs generated by the genesis block and mining rewards are time-locked.
Additionally, this PR:
native_coin
tonative_currency
tasm-lang
compiler so as to run rust code in an environment emulating Triton VMArbitrary
for several structs, including structs that are or hold witness dataarbitrary
methods