February 01, 2023

By stringhandler

Tari DAN Progress

The Tari DAN layer has had some interesting PRs this week. If you’re following along on the DAN Github, you’ll see a few PRs related to NFTs. So this begs the question, exactly what can I do on the DAN?

Can I …. ?

Actually, let’s look at this from two different perspectives, because there is some work under the hood of the smart contracts.

…. as a Validator Node …

Firstly, from a user running a validator node, here’s some things you can do:

1. Register a validator node to run Tari templates?

The first step in running a validator node, is registering a validator node. This may not be the final form of validator node registration, but your validator node will start up and keep itself registered on the base layer. If it stops running, your node will eventually be removed from the validator set. Every epoch (set at 10 base layer blocks at the moment), the validator node set changes according to who has registered and who has fallen away.

2. Sync the latest state?

Before you can vote as an honest node, your validator needs to ge the latest state from its peers. This is working currently, but there is an open problem of verifying that nodes have the latest state before they begin voting.

3. Participate in Cerberus consensus?

Yes, sharded Cerberus is working in a basic form, but there are many caveats.

  1. Only the happiest of paths is working. If any leaders fail or are malicious, the transaction will fail. There is work being done on this by @Cifko and @jorgeantonio21. Specifically they are looking and utilizing existing Hotstuff and Cerberus recovery mechanisms.
  2. It’s not very efficient. The execution of WASM code can be greatly improved
  3. It’s currently not possible to get the result of transactions unless you contact the correct validator node
  4. There’s no API for querying state
  5. There’s very little in the way of indexing state

4. Earn fees?

No, unfortunately at the moment, there’s no way of earning fees, and in fact there are no fees at all in the code.

Next up for Validator Nodes:

  1. Ensure the validator node has the correct state before it votes. Currently, there’s no requirement for a validator node to have the correct state unless that state is related to transactions. The development community looking at ways to address this,
  2. Implement fees
  3. Address Cerberus missing functionality

… as a Smart Contract developer….

1. Write and test my own contracts?

Yes. Well, technically yes. Because the template code is only required to be WASM, you can do anything that Rust (or any other language that compiles to WASM) can do. Can you do something useful? Here’s a list of examples in the code base:

  1. Fungible or ERC20-like template
  2. Basic NFT
  3. Airdropped (or whitelisted) NFT

2. Start using Tari contracts?

The API is still subject to change wildly. It would probably not be wise to start anything serious on Tari at this point, but if you make something cool, let us know about it.

3. Prove ownership?

The ownership and authentication API is not currently developed. This is next up in priority for development

4. Compose multiple contracts together?

Not yet, sorry.

5. Deploy my templates to a network?

While there isn’t a testnet running at the moment, you can deploy templates to a local test network. If you’d like to know more, view this readme or hit up the development team on discord or telegram.

Next up for Contract developers

  1. Ownership, authentication
  2. Composability
  3. Create a testnet