Lately I have spoken with many non-digital artists that were interested in using NFTs to autenticate their work.
The idea is simple: you sell an artwork and transfer an NFT to the owner testifying originality. The NFT 'authentica' will have to be transferred along with the artwork from one owner to the next.
The problem with this approach is that many traditional art collectors do not own a crypto wallet, and as such it is impossible to transfer an NFT to them.
Authentica
is a very simple contract that implements a commit-reveal scheme. It is designed to work in tandem with NFT contracts satisfying the ERC1155 standard. It works like this:
- Artist creates a work and mints an NFT representing it;
- Artist deploys an
Authentica
contract pointing to the NFT contract being used; - Artist sets up one or more 'custodian' wallets and transfers the relevant NFTs there
- Custodian wallet must set
isApprovedForAll
totrue
for theAuthentica
contract. This givesAuthentica
the possibility to transfer tokens from the custodian wallet. - Artist publishes a
secret
onAuthentica
corresponding to thetokenId
, together with anallowance
saying how many tokens of that idsecret
is allowed to withdraw. - Artist prints the secret, e.g. on a QR code, and attaches it to the physical artwork during sale.
...When collector finally sets up a wallet,
- Collector publishes a
commitment
onAuthentica
. This is nothing more than the hash of collector address XORed withsecret
. - When
commitment
is mined, collector revealssecret
.Authentica
verifies that secret andcommitment
check out and transfers the NFT from the custodian wallet to the collector wallet.
The reason why we use a commit-reveal scheme is because Etheremum is a Dark Forest. A simpler solution would most certainly mean that collector's secret would be sniped before reaching a block.
This is your standard Foundry project. Refer to Foundry Github Page for more info.
The way Authentica
should be used is by deploying it as a separate contract. An example of this is provided in the src/examples/
folder: We deploy a NFT ERC1155 contract first, and then we deploy a contract inheriting from Authentica pointing to it.
-
If collector deploys
secret
beforecommitment
there's nothing we can do to avoid mempool sniping. -
allowance
in Authentica does not follow the NFT allowance. That is, you may mint 3 NFTs with id 0 and give an allowance of 500 for a secret pointing to id 0. Trying to spend the remaining allowance will revert unless tokens are returned to a custodian wallet. Long story short: it's up to the artist to set upallowance
in a meaningful way. -
If a collector used
secret
and sells the artwork to a new collector lacking a wallet, a newsecret
can be provided but it requires the collaboration of whoever administers theAuthentica
contract - most likely the artist. This entails transferring the NFT back to a custodian wallet and pushing a new secret onAuthentica
.Alternatively, the collector may set up a new
Authentica
contract pointing to the same NFT contract, but this seems like an overkill application unless collector owns an Art gallery or something along those lines.
I am slowly writing the tests, but any help is appreciated.
I don't expect artists to be procient programmers, so a mock web3 interface with a command center to manage minting, authorizations etc would also be a good idea.