[D13] - NFTrout 🏅

NFTrout is a new NFT platform for generative artists. We are building an off-chain privacy-preserving runtime using Bacalhau and trusted execution environments (e.g. Intel SGX). Artists store secrets in the off-chain system to generate new NFT art.

Challenges

Best developer tooling solution for Filecoin Virtual Machine (FVM)

Pool 10,000 FIL

We forked Bacalhau and Lilypad to support off-chain privacy-preserving computation via Intel SGX enclaves.

Most Useful Web3 Tool

Ranked 2,500 ETH

We implemented off-chain privacy-preserving computation in a way that ultimately should be compatible with any blockchain with a custom smart contract oracle. This has wide implications for any Dapp, for example: - The smart contract can call off-chain code to perform some action off-chain (e.g. execute a trade with my secret API keys) - The smart contract can receive data from an oracle after computing on private data (e.g. determine credit-worthiness from private data)

#BUIDLathon 2023 Infrastructure + Scalability

Pool 15,000 USDC

We implemented off-chain privacy-preserving computation. This was completed by modifying Bacalhau and Lilypad. We then demo how this is used in an NFT generator Dapp.

Best project using Filecoin Virtual Machine (FVM)

Pool 25,000 FIL

We deployed our fork of Lilypad and the Dapp to hyperspace, which communicates with our custom Bacalhau node.

Developer Tooling

Ranked 3,500 USDC

We implemented off-chain privacy-preserving computation in a way that ultimately should be compatible with any blockchain with a custom smart contract oracle. This has wide implications for any Dapp, for example: - The smart contract can call off-chain code to perform some action off-chain (e.g. execute a trade with my secret API keys) - The smart contract can receive data from an oracle after computing on private data (e.g. determine credit-worthiness from private data)

Project details

THE WHY

Privacy-preserving off-chain compute, especially when paired with a smart contract oracle, can be an incredibly flexible and powerful tool for developers. In this hackathon demo, we show one such application.

Digital generative artists today sell runs of their digital art. However, they must either do it on their own computer, or pay for centralized servers to run the art. Running their algorithms on public decentralized off-chain compute networks like Bacalhau don't work because the artists often want to keep their generative algorithms secret. Further, the artist may be integrating private data from the customer/user. Privacy-preserving off-chain compute can help artists securely offload the task of generating art and minting NFTs to a decentralized network.

In the future, privacy-preserving off-chain compute can serve a number of other use cases where developers and/or users may want to store and compute over secret data, including

  • Smart contracts trigger off-chain trades with centralized exchanges using secret API keys

  • Off-chain jobs run on secret user data (e.g. raw banking data) and store results on-chain (e.g. whether it is safe to lend to this user)

THE SOLUTION

This hackathon project comprises of 2 major components:

  1. 1. Privacy-preserving off-chain compute

  2. We forked Bacalhau (https://github.com/bacalhau-project/bacalhau), an off-chain decentralized computation network, to support a new type of resource, trusted execution environments (TEE). We then added a new executor that will allow jobs to run inside an Intel SGX enclave for security and privacy. We also forked Lilypad (https://github.com/bacalhau-project/lilypad), a smart contract oracle, to be able to dispatch jobs and store results on-chain.

  3. 2. NFTrout Dapp

  4. The NFTrout Dapp consists of a frontend UI/UX and a set of smart contracts that will mint new NFTs. The NFT minter dispatches an off-chain privacy-preserving compute job to generate the art and return an IPFS CID for the NFT.

We started with no prior code. The nfttrout monorepo and any modifications to Bacalhau and Lilypad were done during the hackathon week.

HOW IT WORKS

  1. 1. Privacy-preserving off-chain compute

  2. We added a new type of rsource ("TEE") and a new executor to Bacalhau to run python scripts in an Intel SGX enclave wit the help of Gramine.

  3. 2. NFTrout Dapp user flow:

  4. - The artist compiles, encrypts, and uploads their proprietary generative art algorithm into IPFS / Bacalhau.

  5. - The user visits the website and mints a new NFT.

  6. - This triggers a mint call on the smart contract.

  7. - The smart contract uses the Lilypad oracle (https://github.com/bacalhau-project/lilypad) to dispatch a job to generate a new "run" of generative art.

  8. - The resulting art is stored on IPFS and the CID is relayed back to the smart contract to store in the NFT metadata.

  9. - The mint completes and is transferred to the user.