Skip to content

Recipe: Pin files and metadata to IPFS programmatically (Pinata/web3.storage) #20

@PetarStoev02

Description

@PetarStoev02

Description

Recipe showing how to upload images and JSON metadata to IPFS from TypeScript for NFTs, dApps, and decentralized storage.

Why this matters

IPFS is the standard for decentralized file storage in web3. NFT images, metadata JSON, and dApp assets are typically hosted on IPFS. The courses show this with Pinata — we modernize with multiple providers and proper TypeScript patterns.

Scope

  • Upload files to IPFS via Pinata API
  • Upload files via web3.storage / nft.storage
  • Upload JSON metadata for NFTs
  • Pin existing CIDs
  • Construct proper NFT metadata JSON (name, description, image, attributes)
  • IPFS gateway URLs (ipfs://, https gateway, dedicated gateways)
  • Unpin and manage pinned content
  • Cost comparison between providers

w3-kit approach

  • Provider-agnostic: show Pinata, web3.storage, and direct IPFS node
  • Type-safe metadata construction
  • Integration with NFT recipe for full mint workflow

Acceptance criteria

  • Recipe in recipes/evm/
  • Upload to at least 2 IPFS providers
  • NFT metadata construction helper
  • Gateway URL handling
  • .learn.md explaining IPFS content addressing, pinning, and persistence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions