{"id":24628337,"url":"https://github.com/chainrand/chainrand-demo","last_synced_at":"2025-10-08T11:31:20.692Z","repository":{"id":119216511,"uuid":"432699223","full_name":"chainrand/chainrand-demo","owner":"chainrand","description":"Simple demo generative NFT using Chainrand and web3.storage","archived":false,"fork":false,"pushed_at":"2021-12-04T03:33:52.000Z","size":570,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T04:49:57.218Z","etag":null,"topics":["blockchain","chainlink","chainlink-hackathon-2021","chainlink-vrf","dapp","ethereum","ipfs","polygon","solidity","web3js"],"latest_commit_sha":null,"homepage":"https://chainrand.io","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainrand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-28T11:56:45.000Z","updated_at":"2024-12-12T13:59:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"67b57baa-b9f4-482d-826f-2745c080cdfb","html_url":"https://github.com/chainrand/chainrand-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chainrand/chainrand-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainrand%2Fchainrand-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainrand%2Fchainrand-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainrand%2Fchainrand-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainrand%2Fchainrand-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainrand","download_url":"https://codeload.github.com/chainrand/chainrand-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainrand%2Fchainrand-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278934167,"owners_count":26071364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","chainlink","chainlink-hackathon-2021","chainlink-vrf","dapp","ethereum","ipfs","polygon","solidity","web3js"],"created_at":"2025-01-25T05:33:56.708Z","updated_at":"2025-10-08T11:31:20.687Z","avatar_url":"https://github.com/chainrand.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chainrand NFT demo \n\nThis project demonstrates how to use Chainrand to generate a NFT collection off-chain in a verifibly fair manner.\n\nA sample basic smart contract is provided.\n\nThe files are simplified for ease of reading. \n\n# Requirements\n\n- Node v16.9.0 (This is the version used for this project, you may use lower versions if supported)\n\n- An account at [https://web3.storage](https://web3.storage), with an API key. Don't worry, it's free.\n\n# Deployment\n\n1. Publish the smart contract onto your preferred blockchain.  \n\n2. Create an `.env` file in this directory, and add your web3.storage api key to the file.\n   ```\n   WEB3_STORAGE_API_TOKEN=...\n   ```\n\n3. Install the dependencies for this project.\n   ```\n   npm install\n   ```\n\n4. Zip and upload the code to IPFS. This uses web3 storage.\n   ```\n   node upload_code.js\n   ```\n   The script automatically ignores generated content and private files like `.env`.  \n\n   You can also do it manually, but do make sure to remove any private files.\n\n5. Mint a Chainrand NFT at [https://chainrand.io/#/mint](https://chainrand.io/#/mint).\n\n   Use the `codeURI` and `codeHash` values from the previous step.\n\n   Also, decide on a strong `seedKey` and add it to the `.env` file on a new line.\n   ```\n   SEED_KEY=...\n   ```\n\n6. Once the Chainrand NFT is minted, you can visit [https://chainrand.io/#/tokens](https://chainrand.io/#/tokens) to view it.\n\n   Once the `randomness` value is available, copy it to the `.env` file.\n   ```\n   RANDOMNESS=...\n   ```\n\n7. Generate the NFT images and metadata.\n\n   Essentially, the code concatentates the randomness (in base 10) with the seed key, and uses it to initialize Chainrand's deteministic RNG class.\n   ```\n   node generate.js\n   ```\n\n8. Upload the NFT images and metadata to IPFS. This uses web3 storage.\n   ```\n   node upload.js \n   ```\n   \n9. Once minting is over, reveal the NFTs. \n\n    Update the smart contract with the `metadataDirCID` generated in the previous step,  \n    and the `provenance` which is the OpenSea URI of the Chainrand NFT.\n\t\n10. Finally, reveal the seed key in Chainrand.\n\t\n\tGo to [https://chainrand.io/#/tokens](https://chainrand.io/#/tokens) and update the seed key for the project's token.\n\t\n## `.env` file example\n\nThese are just sample values.\n\n```\nWEB3_STORAGE_API_TOKEN=eyJ72dg98GUCU65diikhv10v29uhliug7w2z.eyJ8yf118gpJKlwLWR081chIf9S121\nSEED_KEY=Pl3aseReplaceThisWithY0ur0WnS33DKey\nRANDOMNESS=5892501820275885219648139503635653097827932529095672731392738198242665230727\n````\n\n# Note\n\nIf you prefer to use another language, just take note to follow the general steps.  \n\nYou can use one of the Chainrand deterministic cryptographically secure RNG SDKs for your off-chain RNG.\n\n# Credits\n\nThe traits are provided on courtesy of [https://sorasdreamworld.io](https://sorasdreamworld.io)\n\nDo visit them to check out the full collection.\n\n# License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainrand%2Fchainrand-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainrand%2Fchainrand-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainrand%2Fchainrand-demo/lists"}