DUSK Contract ContractDUSK forms the backbone of the Dusk Network protocol.
The contract is responsible for the accounting of the native protocol asset called
DUSK. DUSK is utilized as a Sybil-resistant participation token in SBA consen-
sus mechanism, as well as the medium for subsidizing computation costs of the
consensus participants (i.e. medium for transaction fee payment). ContractDUSK
utilizes Phoenix as the underlying transaction model. The ContractDUSK.F
Execute
function acts as the entry point to state transition initiation for non-Coinbase
transactions. Specifically, ContractDUSK.F
Execute function takes the following in-
put:
Inputs, Crossover?, Outputs, Fee, πexecute
plonk , calldata,
where Inputs and Outputs are previously defined in the Phoenix section, Crossover
is an optional entry represting a unique note acting as bridge for DUSK between
the transactional and generalized compute layers, Fee is the fee allocated as a
reimbursment for the transaction computation costs, π
execute
plonk is a zero-knowledge
proof attesting to the validity of the transaction and calldata is the data attached
to the transaction enabling it to initiate a contract call. We define Crossover as:
Crossover ← (c, denc),
where c is the commitment to the value v of DUSK being bridged and d
enc
are the encrypted openings of commitment c to the derivative of Fee.pk. Fee is
defined as:
Fee ← (gasPrice, gasLimit, R, pk),
where gasPrice is the price per gas in DUSK, gasLimit is the maximum allowance
of gas for the execution of said function call and (R, pk) is the stealth address
to which a refund will be issued if the not all allocated gas is consumed. If, for
some reason, a Crossover is not consumed during the exection of the call, then
then an additional refund note is issued to (R, pk).
ContractDUSK.F
Execute function requires the following steps to be amended to 3. Step 10 to be substituted with vin − v − vout − fee.
In total, ContractDUSK is comprised of the following non-spurious functions:
1. F
SendToContractTransparent, enabling a user to send DUSK in a transparent
form to a contract.
2. F
SendToContractObfuscated, enabling a user to send DUSK in an obfuscated
form to a contract.
3. F
WithdrawFromTransparent, enabling a contract to withdraw transparent DUSK
to a user in an obfuscated form.
4. F
WithdrawFromTransparentToContractTransparent, enabling a contract to withdraw
transparent DUSK to a contract in a transparent form.
5. F
WithdrawFromTransparentToContractObfuscated, enabling a contract to withdraw trans-
parent DUSK to a contract in an obfuscated form.
6. F
WithdrawFromObfuscated, enabling a contract to withdraw obfuscated DUSK
to a user in an obfuscated form.
7. F
WithdrawFromObfuscatedToContractTransparent, enabling a contract to withdraw ob-
fuscated DUSK to a contract in a transparent form.
8. F
WithdrawFromObfuscatedToContractObfuscated, enabling a contract to withdraw ob-
fuscated DUSK to a contract in a transparent form.
9. F
Execute, enabling a user to pay for the transaction fee, send DUSK to
another user and initiate a contract call.
7.5.2 Bid Contract
ContractBid is utilized to enable prospective Generators to lock their bids in or-
der to join the consensus, update the expiration height of their existing bids
and withdraw the said bids once the expiry height has elapsed.#DUSK $DUSK @Dusk
