Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Scheme

Let be defined as in Vesting Configuration Model.

Let be defined as in the section Coin.

Let be defined as in the section Pallas and Vesta.

Let be the current blockwindow as defined in Blockwindow.

Let be defined as in the section PoseidonHash Function.

Let be defined as in the section Verifiable In-Band Secret Distribution.

Denote the Vesting contract ID by and its Exec function spend hook by .

Vest

This function creates a vesting configuration bulla . We commit to the vesting configuration params and then add the bulla to the set, along with the vested coin minted by the child Money::transfer() call. Each vesting configuration keeps track of its minted coins, to ensure that only those can be burned in next actions, creating a sequence of coins, enabling the contract to keep track of remaining balances anonymously. Additionally, we verify the minted vesting coin is encrypted for the configuration shared secret key, ensuring both parties have access to it.

  • Wallet builder: TODO: add client path
  • WASM VM code: TODO: add entrypoint path
  • ZK proof: TODO: add proof path

Function Params

Define the vest function params

TODO: Add call params path

Contract Statement

Vesting configuration bulla uniqueness   whether already exists. If yes then fail.

Let there be a prover auxiliary witness inputs:

Attach a proof such that the following relations hold:

Proof that start blockwindow is greater than current blockwindow.

Proof that end blockwindow is greater than start blockwindow.

Proof that total is greater than cliff.

Proof that blockwindow value is valid.

Proof of vesting authority public key ownership.

Proof of shared secret public key ownership.

Vesting configuration bulla integrity

Minted vested coin integrity

Verifiable vested coin note encryption   let , and verify .

Signatures

There should be a single signature attached, which uses as the signature public key.

Withdraw

This function enables the vestee to withdraw the corresponding unlocked value up to that blockwindow. The child Money::transfer() call must contain a single input, the vested coin we burn, and two outputs. The first one being the withdrawed one while the second one is the remaining vested balance coin. Both coins values are verified by the vesting configuration rules, and we store the second one as the current vested coin, to burn in next actions. Additionally, we verify the second/vested coin is encrypted for the configuration shared secret key, ensuring both parties have access to it.

  • Wallet builder: TODO: add client path
  • WASM VM code: TODO: add entrypoint path
  • ZK proof: TODO: add proof path

Function Params

Define the withdraw function params

TODO: Add call params path

Contract Statement

Vesting configuration bulla existance   whether exists. If no then fail.

Burned vested coin existance   whether the burned coin matches the vesting configuration record one. If no then fail.

Let there be a prover auxiliary witness inputs:

Attach a proof such that the following relations hold:

Proof of vestee public key ownership.

Proof of shared secret public key ownership.

Vesting configuration bulla integrity

Proof that current blockwindow is greater than start blockwindow.

TODO: cond_select statement to pick current or end blockwindow

Proof of withdraw amount correctness

Verify the child Money::transfer() call correctnes:

Burned vested coin integrity

Burned vested coin nullifier integrity

Minted vested coin integrity

Verifiable vested coin note encryption   let , and verify .

Signatures

There should be a single signature attached, which uses as the signature public key.

Forfeit

This function enables the vesting authority to forfeit a vesting configuration, withdrawing the rest of vested value. The child Money::transfer() call must containg a single input, the vested coin we burn, and a single output, the newlly minted coin. Both coins values are verified by the vesting configuration rules, and we remove the vesting configuration bulla entry from the set.

  • Wallet builder: TODO: add client path
  • WASM VM code: TODO: add entrypoint path
  • ZK proof: TODO: add proof path

Function Params

Define the vest function params

TODO: Add call params path

Contract Statement

Vesting configuration bulla existance   whether exists. If no then fail.

Burned vested coin existance   whether the burned coin matches the vesting configuration record one. If no then fail.

Let there be a prover auxiliary witness inputs:

Attach a proof such that the following relations hold:

Proof of vesting authority public key ownership.

Proof of shared secret public key ownership.

Vesting configuration bulla integrity

Proof of forfeit amount correctness

Verify the child Money::transfer() call correctnes:

Burned vested coin integrity

Burned vested coin nullifier integrity

Minted coin integrity   let be the vesting authority chosen Contract ID, spend hook and user data for the minted coin, and verify

Signatures

There should be a single signature attached, which uses as the signature public key.