---
# System prepended metadata

title: Prompt

---

# Prompt
Crowdsource prompts – build art and an audience with AI-generated NFTs.

## Codebase
### promptApp
This folder contains all of the frontend code. 

### promptContracts
This folder contains all of the smart contract code. The primary contracts are the FactoryContest.sol and Contest.sol. 

The FactoryContest creates new contests and maintains basic information about voting and available contests. Contest.sol is built on top of the ERC721 interface built functionality to fit our needs.

### stableDiffusionServer
This is a microservice we created that runs a stable diffusion model and hosts a web server that can accept requests since there are very few functioning platforms that provide good image generating APIs.





![](https://i.imgur.com/E0GhfyD.png)

## Strategy / Value Proposition
- Prompt is platform built on the Canto blockhain that enables crowdsourcing of AI-generated NFTs through a contest model
- Value Proposition:
    - For contest creators:
        - Crowdsource art for personal / business needs (e.g., logo for a company, art for a website, background for social media profile) that you can own as an NFT
        - Generate buzz and virality for personal / business projects and needs (think like Product Hunt)
    - For prompt submitters:
        - Opportunity to win Canto tokens for prompt submissions
        - Opportunity to receive acclaim and recognition for viral NFT art
- Why AI-generated NFTs? Why contest model?
    - AI-generation through a contest model is a low-friction method of creating art that's implictly viral, attracting a large crowd of participants / consumers 

- NFTs are difficult to make quality and quantity wise, AI generation aids in it significantly

- Value of the NFTs
    - Speculative cost
    - Access and contribution to Prompt 'graffiti' board
    - Discount / Benefit for creating a promptest

- Contest model may not remain in future versions
- could list contest and auction off if high quality

### Future Features
- NFT marketplace
- PNL / leaderboards
- Graffiti style membership for users that have won promptests in the past
- sell promptests
- judge dao
- prompt token

## Tokenomics
 - All users are able to sponsor contests using Note
     - Contest holds a locked pool of note for the contest to be minted to contestants WRT vote distribution. 

## [Contracts](https://hackmd.io/WaLNRhM0QVyayEm12g30DQ)
### Contest Factory
- Factory mints a contest for each user
- Each contest has a unique id (create2 opcode of contents, etc.)
- Contest sponsors can create a winning distribution which handles how many users can win the contest as well as the amount that they can earn (ratio).

### Contest Router 
- Router routes submissions to contract pools
- Router routes votes on each contest to the correct pool
- Also has admin functions for judges that will route their votes to the correct pools
- Router maps Contest Contract addresses to a CID (Contest Identifier),
### Contest Contract (ERC-721)
- Holds all locked funds for contest
- Holds all submissions for contest
- Holds all current judges, ref to govShuttle so that the judge-set can be updated
- Holds all of the NFTs minted by the stable diffusion microservice. 
- Each NFT is associated with a specific entry (stable diffusion image). 
- Ownership of the NFT is transferred to the contest contract so that the NFTs can be held in escrow as the contest is being held. 
- When the contest is over, all of the NFTs' ownership is tranferred over to the contest sponsor.


## UI
https://www.figma.com/file/7ReieREtApUqlHJrj56K2X/Dale-Wilson's-team-library?node-id=411%3A2
- Integrate stable diffusion as the background. Cache a few hundred images that were pre-created and swap the images as users load on to the page.
    - In the future, use previous contest winners as the background. 
- Akira themed
- Cyberpunk
- Curve

## UX
### Creating a Contest
Sponsors will be required to enter the a pot amount, contest name and brief description about the contest's purpose. The description should inform users on the direction in which users should take to create the prompt. Additionally, the sponsors can optionally enter in a submission fee that users must pay to take part in the contest.

### Voting
Voting on submissions will be handled through the contest router. Methods for accessing vote history / voting will be only accessible to the active judge-set during the duration of the contest.

### Nominating Judges
Judge nomination will be handled through governance. It will be handled through a method on the router only accessible by Timelock, i.e - Canto DAO (On Canto) governance will handle active judge-set for prompt contests.

Alternatively, we can allow the contest holders to enter in a set of addresses which are allowed to vote. Each address will be allocated a certain number of votes which can then be distributed amongst the submissions.

### Submitting an Entry
Entry submission will initially be handled in Router, sent to specified Contest contract, and the NFT for the submission will be minted through there.

### User Portfolio
Users can view all of the contests that they are taking part in as well as their submissions. Users can see historical information about their previous submissions including winning entries, P/L, and their global leader board position.

There will be a leaderboard that displays how much P/L, % returns, and number of winning submissions each user etc.

### Analytics
Users should be able to sift through previous contests and look at statistics surrounding each contest and the platform in general. This can be things such as
- Total number of contests held
- Total amount of Note distributed through the contests
- Addresses that have won contests before + their submissions
### Marketplace (potentially)
Contest holder should be able to auction off the NFTs that they selected as winners. Additionally, users that did not win the contest are able to submit their NFTs in auctions. Each contest will be treated as a separate collection.

### Contest Auctioning (potentially)
Each contest can be auctioned off to other users who would like to potentially 'own' the collection that will be created. If a user sees a contest that they like and want to have the ability to take ownership of it, they must pay a small tax to the existing owner of the auction in order to gain ownership of the subsequent winning submissions.

## Dependencies
### Microservices
#### Twitter API
Since virality is a portion of the total vote, there will be a need to create a mechanism that can properly verify NFT virality on Twitter. This will require us to have several API tokens and possibly a Twitter oracle.

#### Stable Diffusion
This can either be integrated using the existing APIs that are available or we run our own version of the models. Alternatively, this can be a simple image that is entered through the UI. 

This image must be stored on IPFS, minted as a NFT through the ERC721 smart contract, and then held in escrow by some smart contract until the prompt contest is over. Upon finishing, the winning NFT is transferred over to the contest holder and all other NFTs are released back to the original minters.

#### Interacting with Smart Contracts
Requires ethers JS to be used to vote, nominate judges, fee distribution, mint the NFT, transfer NFTs, submitting entries, and creating new contests.

## Roadmap
### Phase 1 (MVP)
#### Contest Contract (ERC-721) ✅
 - Functionality for accruing / escrowing Canto
     - failed sponsor attempts should be able to redeem their sponsorship attempt
- Submission of URI for stable diffusion image, escrowing of image and NFT ownership to the contract
- Functionality to checking active judge-set, and voting on submissions for contest
- Functionality to transfer all NFTs to sponsor of the contest once the contest is over
- Functionality to transfer all funds from the pool to the winning submissions
    - Figure out how to do tie breakers
- Functionality for checking block.timestamp and a final time during which the contest will end

#### Contract Factory Contract
- CreateContest method (deploy the contest contract bytecode) maintain addresses of the contest contracts
- Deterministically deploy the contest contracts
- Maybe determine the address of the contest from the seed used during contest creation
- Functionality to enter in judges, pot amount, and reward distribution
    - Judges will initially be hardcoded addresses
#### Contest Router
 - Reference to factory, as well as all of the entered contests
 - Functionality for delegating submissions, votes, sponsorships to required contest.

#### Tokenomics
Submission Fees
- 5% goes directly to PROMPT developers
- 5% goes directly to PROMPT judges
- 90% goes directly to PROMPT sponsor


Entry Pool Fees
- 10% goes directly to PROMPT developers
- 5% goes directly to judges
- 85% goes to the NFT smart contract

#### UI
*Pages*
- Contest creation page
- Submission page
- Voting page
- View all contests page
    - Viewing all NFTs per contest

#### Backend
- API that consumes a image/gif that is written to IPFS and mints a new NFT
- API to find all existing contests
- API to vote on contests
- API to create a contest
- API that transfers ownership of the NFTs to the sponsor
- API that allows sponsors to claim submission revenue
- API that allows users to claim rewards
- Integrating Twitter virality into the voting process

#### Twitter Integration

#### Questions
- Should judges be set for each contest be set by each contest sponsor?
- Do we want to do blind voting?
- Crowdsourcing voting for contests, maybe open it up to the public by
    - allowing individuals who submitted to vote for other submissions (not their own)

### Phase 2 (Extend Contest Functionality + Leaderboard + Auction)
#### Contest Contract
- Functionality to allow a DAO to select a set of judges over all of the contests
- Functionality to allow users to take over ownership of a contest by entering an new pot amount that is higher than the existing contest pot
- Functionality to distribute a tax to the original contest sponsor if ownership of the contest is transferred to a new user
- Functionality to allow multiple winners
 - Contests become NFTs themselves??? 
#### UI
*Pages*
- Leaderboard page
- Auction contests page

#### Backend
- API to bid on an existing contest in order to take ownership
- API to cash out the revenue generated from taxes for the original contest sponsor
### Phase 3 (Marketplace)

## Questions
- Does every contest have its own judge?
- Will it be possible for there to be multiple sponsors for a contest? 
- Can there be an auction for the sponsorship of contests?
    - Through the duration of the contest, sponsors are able to bid for the winning submissions?
    - Original sponsor receives tax from subsequent submissions / final pot


## Presentation Notes
Structure
- NFT use case, val prop, and current issues
    - Current issues:
        - Difficult to create NFTs
        - Difficult to build NFT community
        - Lack of intrinsic value beyond speculative cost
- AI-generation overview, and how it solves those problems
- PromptNFT overview
         - Solves NFT creation through AI generation
         - Solves community building through crowdsourcing
         - Solves NFT value by creating exclusive benefits (e.g., art board, discounted promptests)
     
     
     
## Script
### Contest creator workflow & creating contests

Starting contests is simple, you enter a description for what type of art you want, a contest pot amount which is the deposit you make to create and incentivize people to participate and a submission fee. ill walk through creating a sample contest in a bit

### Voting

Voting for the best submission to a promptest is done by a hand-picked set of judges (judges will later be elected through a PROMPT DAO)

### Reward Distribution

at the end of a promptest
- the total amount of submission fees plus the initial pool amount is split between the developers, judges and winning submissions

### Prompt Club

Although we didnt have the time to build out every feature we wanted, moving forward we were thinking of building out exclusive prompt club memberships where users can have exclusive access to
- registering users to addresses
- leaderboards
- community gallery
- a new marketplace

### Contest Creator Workflow
create a contest
prototype me the car that we will all be driving in 2080

### User Workflow
- 


### Features to cover
- Create page
    - We'll start at the create page, which is where contest creators can define what their 'promptest' will look like.
    - It could be a company looking for a logo, a project looking for a website background, or a person looking for a twitter pfp.
    - So first, you'll write out a brief description of the contest, and then you'll provide some details about yourself as the host / creator, as well as the end date of the promptest, the pot amount, and the submission fee.
    - I'll briefly pause here and explain promptNFT functionality and context--the submission fees and pot amount are pooled together, with the winning participant receiving 85%, developers receiving 10%, judges receiving 5%. Judges are currently hand-picked but will later be elected through a DAO, and the judging process will also eventually incorporate an element of social media virality. The winning submission of a contest is then minted as an NFT belonging to the contest creator.
    - Continuing with the prompt workflow--once you've written everything and connected your wallet, you can create the promptest, then go to the promptest page to view it. 
- Promptests page
    - The promptest page provides an overview of all currently active promptests, listing their pool amounts, submissions, and submission fees.
- Individual promptest page
    - If we click on an a particular prompest, we can see more details, like its end date, and view a gallery of current submissions from other participants.
    - We can then click on the 'make a submission' button, where we can then write our prompt, produce an AI-generated image, and, if we like it, submit it into the promptest for the stated fee amount.
    - If we go back to the gallery, we can see the 'distribute rewards' button, which is where participatns and judges can claim their rewards at the end of the contest
    - once rewards are dripped to each account, users just have to click claim x amount of canto and the rewards are sent to their wallet
    - Once a contest is over, the prompt that each submission used will appear with a green outline

script end

    - Overview
        - information about total amount of winning canto
        - total amount of contests
        - community submissions
    - Each contest tells you what type of art you need to make, how much you can win, and how much it costs to enter
- Individual promptest page
    - information
        - some more info about the contest, end time, and so forth
    - There are two primary tabs
        - gallery tab where you can view all submissions, 
            - judges can vote on submissions here
            - contest hosts can claim the submissions as nfts at the end of a contest
            - participants and judges can claim their rewards here as well at the end of contests by clicking the distribute rewards button which will drip the claimable rewards to each account
            - once rewards are dripped to each account, users just have to click claim x amount of canto and the rewards are sent to their wallet
            - Once a contest is over, the prompt that each submission used will appear on each card
        - the submissions tab
            - here users enter in a prompt, generate their image, and make a submission to the contest
                - users can make as many submissions as they like
- 


