GameFi
  • General Intro
  • πŸ“ƒR & D
  • πŸ’»Workshop
    • 🏎️NFT Web App Integration
      • πŸ“„Prerequirements
      • Decentralized Storage
      • Smart Contract NFTs
      • Creating the React Dapp
      • Updating Startup File, Wallet Connect & Main Menu
      • Fetching NFTs, Stacks and Hiro API
      • Rendering NFTs owned
      • Selecting an NFT
      • Mapping Scenes
      • Creating the playable game
  • πŸͺ™Trustless Rewards - M1
    • General idea
    • Flow Lobbies
    • Smart Contract
  • 🎨Customizable NFTs - M2
    • General Idea
    • Flow Customizable NFTs
    • Smart Contracts
      • Component
      • Customizable Wrapper
  • 🎁Lootbox on Chain - M3
    • General Idea
    • Tech Explained
    • Smart Contracts
      • Item
      • Lootbox
      • Lootbox Manager
  • πŸ“Message Signing
    • General Idea
    • GameFi Use Cases
    • App Explained
  • πŸͺ΅SFTs
    • General Idea & Base SFTs Static Deployments
    • Metadata Structure
    • Static Flow and Smart Contracts
    • Advanced SFTs Dynamic Deployments
    • Dynamic Flow and Smart Contracts
    • Dapp Integrating SFTs
      • Front End
      • Back End
    • Resources
  • ⚑Subnets
    • Overall for subnets
  • Roadmap
  • πŸ’ΎDecentralized Storage
    • Gaia
    • Pinata
    • Host SFTs and NFTs into Pinata
    • Gaia integration to host game resources
  • πŸ”—External Knowledge
    • Getting Started
    • Hiro API
    • Stacks Docs
    • Clarity Book
    • Hiro Tutorials
Powered by GitBook
On this page
  • About decentralized storage and Pinata platform
  • About the resources used
  • Prepare resources and store them

Was this helpful?

  1. Workshop
  2. NFT Web App Integration

Decentralized Storage

PreviousPrerequirementsNextSmart Contract NFTs

Last updated 2 years ago

Was this helpful?

About decentralized storage and Pinata platform

The InterPlanetary File System, also known as IPFS, is an incredibly powerful protocol that allows creators to host content too large for blockchains on a decentralized peer-to-peer network, leveraging cryptography to ensure content is unable to be changed.

The IPFS network is ideal for NFT projects that want to decentralize (transfer control from a centralized entity to a distributed network) their NFT media and make sure it does not change over time. IPFS also allows creators to take ownership of their content and how they share it.

Pinata is an NFT media management service that allows users to host, manage and share files of any kind on the blockchain of their choice. Pinata is the easiest way to pin content to IPFS and build web3 applications without having to build and manage your own IPFS nodes.

To support content addressing, we need to come up with some way to create a β€˜fingerprint’ or summary of the content that we can use to reference said content. Similar to finding a book, where we use ISBN numbers. In practice, web content addressing systems such as IPFS use cryptographic hashing functions to create fingerprints. We take the raw content (in this case, the folder with images and the folder with JSONS), and run that data through a hash function, to produce a digest. This digest is guaranteed to be cryptographically unique to the contents of the file (or folder), and that file only. If I change that file by even one bit, the hash will become something completely different.

The link to a specific file inside the folder would be hash/fileName.

​

About the resources used

Non-fungible tokens - NFTs for short - are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. In general, it is helpful to have a name, image and attributes that represent this content. This is stored as metadata on the JSON files. Every unique identifier should point to a URI referencing its metadata.

We have two folders containing images. images-NFT contains the images that are displayed on the marketplaces and on the menu when selecting which character to play. images-in-game contains the images which have the motions of the character when moving in-game. We also have a folder for metadata called JSONS-NFT.

First, the folders containing images will be uploaded on a decentralized platform and will have attributed specific hashes. Then the JSONS will be checked to have the corresponding IPFS links to the images. Afterward, the JSONS folder will be uploaded and will have a specific hash.

There are always attributed the same hashes for the same bits so we already know the specific hashes for images and JSONS and updated them.​

Prepare resources and store them

  1. Download resources from GitHub repo terminal command: git clone git@github.com:BowTiedDeployer/workshop-nft-integration.git

  2. Upload the folders inside jsons-and-images folder on Pinata. After uploading them, the folders should have attributed the following hashes:

    1. images-in-game - QmP1fB7x9JSMHtLmEoqEoFnnQMC1GCJ64DPCrDBxCKS23a

    2. images-NFT - QmNz74TN66hgi9X4wZ1ch9hXKxaywG5soEQPMfDqEMLVsd

    3. JSONS-NFT - QmNLo4oeN741Ai5PEafBnDtpXh2XMea8wBUGicTeErCtEB

πŸ’»
🏎️
https://github.com/BowTiedDeployer/workshop-nft-integration