Learn to Create Fully On-Chain NFTs With SVG Smart Contracts

Added:

On-Chain NFTs
SVG & Base64
Contract Setup
Building SVG
Metadata JSON
Adding Randomness
Word Struct
Test Deploy

On-Chain NFTs

0:00
Playing Section
  • 1

    Explains the difference between on-chain and off-chain NFTs.

  • 2

    On-chain data lives in the smart contract, not on IPFS.

  • 3

    Uses SVGs to render images directly from blockchain data.

Fundamental proficiency in Solidity programming, including smart contract structure, state variables, and inheritance.
A solid understanding of the ERC-721 standard (NFTs) and how tokenURI metadata is typically structured.
Basic knowledge of SVG (Scalable Vector Graphics) XML structure and how vector shapes are defined using code.
Understanding the concepts of Base64 encoding and Data URIs used to represent media inline.
Implementing dynamic on-chain metadata that allows SVGs to visually morph based on smart contract state changes or external oracle data.
Advanced gas optimization techniques for large on-chain payloads, such as using SSTORE2 or Huffman coding.
Developing a web3 front-end application to programmatically query, decode, and render the Base64-encoded SVG NFTs in real-time.
Deploying and benchmarking these gas-intensive contracts on Ethereum Layer 2 networks like Optimism or Arbitrum.
39.6K views1.2Klikes1:31:06@HashLipsAcademyOriginal Release: 2021-10-06

On-chain NFTs store all content directly on the blockchain using SVG (Scalable Vector Graphics) images encoded in base64 format, eliminating the need for external servers or IPFS. The process involves creating a simplified ERC-721 smart contract that generates SVG images on-chain using mathematical equations, encoding them with base64, and returning them through the tokenURI function to create fully on-chain NFTs that can be displayed on platforms like OpenSea.