Genesis Contracts: Transfer Contract

Mar 27, 2020

By: Mels Dees

And more on one of Dusk Network’s Genesis contracts

The Transfer Contract is a way to transfer DUSK through the means of a smart contract. It unifies the state difference between DUSK and all other on-chain tokens in the network to prevent a lot of issues down the line. From a framework perspective, this demo shows interaction between the Phoenix transaction model and RUSK, the Dusk Smart Contract Platform.

The Transfer Contract is one of the genesis contracts, which means it is part of the contracts that are deployed to the blockchain with the very first block. The Transfer Contract, like other genesis contracts, plays a key role in the Dusk Network protocol, alongside the Fee Contract, the Blind Bid contract and the Staking Contract. As shown below, the Transfer Contract resides in the so-called blockchain layer.

This Technical Framework shows the different layers and components of the Dusk Network. Read more about how it all ties together.

Contract benefits
The DUSK Transfer Contract is designed to alleviate the separation line that has existed between the assets deployed on-chain and DUSK. In other words, the Transfer Contract creates an easy way for network participants to transfer DUSK through the means of a smart contract as it streamlines a single standard way of interacting with any asset deployed (via a smart contract) on-chain.

Going forward it's important to understand what a state is: “A state is a set of data that represents the worldview of the protocol at a point in time. Two examples: 1) the state of your bank account is the account balance, and 2) the state of a savings bank would be the total account balance of all their clients account balances, and the separate record of all their clients account balances”.

The Transfer Contract makes sure that we only have to manage one global state. Without it, we’d have two concurrent states. One located outside of the “smart contract realm”, and the other within the “smart contract realm”. Managing two concurrent states is more costly because we’d need to use additional measures to prevent the possibility of race conditions.

“A race condition is an undesirable situation that occurs when a system tries to perform two operations simultaneously, whereas the operations should be done in a proper sequence to be done correctly.”

Implementing the Transfer Contract is an important addition to the Dusk Network blockchain, with similar proposals made for other protocols, including Ethereum. In Dusk Network, the Transfer Contract further eases the synchronization of nodes in the network, leading to increased reliability of the network. Additionally, it makes it possible for other services and contracts to be easily integrated with DUSK.

DUSK vs on-chain assets
Compared to other on-chain assets (e.g. XSC based security tokens), DUSK has many privileges. Most importantly, DUSK is the sole native asset permitted to be utilized for settlement of computation costs, or fees.

“A Dusk Network Enhancement Recommendation (DER) is a documentation standard for protocol enhancement proposals”

Transaction confidentiality
The transfer contract is based on the DER-2 Confidential Token Standard and has additional features derived from DER-3 DUSK Token Contract that provide the contract with protocol-wide privileges. As the contract utilizes Phoenix as the underlying transaction model, contract users also retain the anonymity guarantees of Phoenix. Which means, spectators have no way of knowing anything about the contents of the transactions on the blockchain. In other words, only the participants of the transaction have knowledge of the contents of the transaction. That is what we call privacy.

Tech demo
In the demo we use a blockchain node to perform a confidential transaction for the total amount of 100 DUSK. Developer Jules de Smit explains what happens in the background as the GRPC client connects to the RUSK server, which has access to the virtual machine and contract storage.

Watch our demo and see the transfer contract in action!



Up Next: Fee Contract
In our next demo developer Jules will highlight the Fee Contract and explain how it helps manage block reward distributions.

Share this post

Subscribe to our newsletter

Dusk on GitHub Download Whitepaper