What is the Dice Project?

Many things in our world are random. Fantasy worlds aren't unique in that sense. But they come of help for true adventurers. As they say, sometimes a good decision is a random one, and sometimes a good strategy is a random one. The dice are an NFT. But they are also a symbol and a utility in one neat package.

What are the main use cases?

The Dice has several built-in utilities. The first one is the animation, of course. It allows you to roll the dice right from your wallet or OpenSea. The media is great for checking the chance or playing AD&D in various forms with your friends. There are different types of dice, and the animation matches the type of dice you claim, so grab one or many to have the set. For instance, there is even two 6-sided dice in one NFT for your convenience;

The Dice contract can also perform random rolls. You can perform a roll via a view function. This method can be called by any UI that allows smart contract interaction, for example, Etherscan. A random value is regenerated roughly every 16 seconds (with each new block).

You can also roll the dice as a transaction. It can be used by other smart contracts as well. In this case, a number generated produces an event that will be recorded onto blockchain (making it provable and persistent). This function is only allowed if the caller (or initiator of the transaction, if a call is made via another smart contract) has the Dice NFT in their wallet.

Are there any claim restrictions?

No, anyone can claim any number of Dice NFTs. There are no fees (except gas). It is an open project, and you can use it as you like.

What type of dice are available?

Oh, there are many. You can claim (matching a complete AD&D set): 4-sided, 6-sided, 8-sided, 10-sided, 12-sided, and the prettiest of them, a 20-sided dice.

What is special dice?

There is a chance that during a claim (probability is around 1%) that a Dice NFT claimed will be a "Special Edition" type, boasting custom coloring. Those should be pretty rare and should be sought after :)

How can I watch and play my Dice NFT?

You can see the whole collection on OpenSea. You can also connect your wallet and find your Dice NFTs there. And, the best part is that you can roll your dice on each NFT page. Other NFTs platforms would, hopefully, support interactive NFTs soon too.

What are the main technical use cases? (extended answer)

The Dice NFT has several built-in utilities. The Dice contract can perform random rolls. For instance, via a view function, not requiring a transaction. Please note, to avoid cheating or brute-force of value, the Dice contract has to rely on new block data to generate new value. It means that it will produce the same number until a new block is mined (generating a new random value roughly every 16 seconds).

The Dice can be used as a transaction, usable by other smart contracts. In such a case, a caller can pass an arbitrary numeric value, or, even, a minuscule amount of ETH as tx.value. For better randomness, a number generated also increases contract global state variable and consumes blockchain information as a random source (block hash, timestamp, number, miner address than mined previous block). If a powerful miner can include the roll transaction in the block, they can read the value beforehand with some degree of certainty (if they would mine the block). Thus the generated values should not be used for critical applications in terms of security or cryptography.

It is also a reason to limit the number generated in one rollTx() call (however, it can be called multiple times). As for the gaming application, it can be used with a very reasonable degree of confidence.

Why is the contract upgradeable?

The code for the smart contract is open, and any contributions are welcome to improve random generation methods. Some possible improvements could include: commit-reveal scheme for a user, reading values from liquid pools or an oracle; providing additional limited-edition dices, etc.

A separate GitHub repository will be opened soon for those purposes. Meanwhile, you can find the contract source on Etherscan.