Simple-nft-tutorial - A simple tutorial on making nft/memecoins on algorand

Overview

nft/memecoin Tutorial on Algorand

Let's make a simple NFT/memecoin on the Algorand TestNet! We'll use the Purestake API, NFT Storage, and the Algorand Python SDK to programmatically create some coins/nfts/assets. 1

Tip: If you want to speedrun through this tutorial, just read each heading and the tl;drs at the end of the section.

Pre-requisites

  • You should hopefully know how to open the terminal and use a code editor. On MacOS or Ubuntu (any Linux-based OS), just open up your terminal. If you are on Windows, I recommend you install WSL, and you will be able to run a Ubuntu terminal on your machine.
  • Your machine should have git and python installed.

Clone this repo

Open up your terminal and paste the following commands:

git clone https://github.com/algochoi/simple-nft-tutorial.git
cd simple-nft-tutorial
python -m venv .venv # optional
source .venv/bin/activate # optional
pip install -r requirements.txt

Create your first Algorand account

An account consists of a public key and a private key.

  • The public key (aka wallet address, or Algorand address, which is an encoded form of the public key) is like your banking number that people can use to send you money. This is okay to share with your friends.
  • The private key (aka secret, or sometimes mnemonic, which refers to a set of English words that can be translated into a private key) is like your banking PIN. It's probably not a good idea to share your PIN in real life either, so DO NOT share your private key with anyone!2

If you run python create_account.py, it will automatically generate your address and secret in a private .env file. Do not share or upload this file anywhere (by default, .env is listed in this repo's .gitignore). We will also use this file later to put our API keys. Please just run the script once, or else it will overwrite all your secrets.

tl;dr run python create_account.py in this directory and it should generate a .env file with your address and secret. DO NOT share your secret with anyone.

Fund your address

For TestNet, we have a bank/faucet that gives you free Algos to test out your program. Go to the faucet, enter your address and get some free money. The funds may take ~10 seconds to settle, but you can check out your funds on the blockchain using AlgoExplorer. Enter your address in the search bar and confirm that your balances are set to 10. algoexplorer screenshot

tl;dr Go to the faucet, enter your address and get some free money.

Create a Purestake API-Key and save it to your .env

We are going to use an external API to make requests to the blockchain. Sign up for a free Purestake account. When you log on, you should see your API key (where the greyed out box is in the screenshot below).

purestake screenshot

Don't expose that to the world either - write it down in your .env file in the PURESTAKE_KEY field.

env file screenshot

Upload your beautiful image using NFT.storage

There are many ways of uploading your data or image, but we will use NFT.storage, which will store your image in decentralized IPFS. This way, the should be able to live for a long time in public storage 3. Sign up for a free account, click on Files, and upload your beautiful image! nft storage screenshot

Copy the CID from the site and note it down somewhere as we will use it in the next step!

Customize your coin!

Open create_nft.py with your favorite editor, navigate to the top where it says # Configurable parameters, and customize your asset by changing the TOTAL_SUPPLY (1 means it is a NFT, more than 1 is a custom token/coin/asset), YOUR_UNIT_NAME, YOUR_ASSET_NAME, and YOUR_CID 4. When you're done, save your editor and run python3 create_nft.py. It should take 5~10 seconds to confirm and finalize your transaction on the blockchain 5.

When the transaction goes through, the Python script should output a link to your new asset! e.g. Go to Algoexplorer to look at your beautiful asset: https://testnet.algoexplorer.io/asset/your-asset-here

You should be able to see your new coin/nft on the blockchain! You can view asset information on Algoexplorer by clicking Technical Information and then Creation Tx, which should show you details about your shiny coin. You can access an ipfs url anytime by copying the CID to the end of https://ipfs.io/ipfs/, i.e. https://ipfs.io/ipfs/YOUR_CID_HERE. Here's a dummy example.

tl;dr Edit create_nft.py with your token params and run python3 create_nft.py. It should generate two links for you to look at your shiny asset.

Transferring assets

Now that you have created your asset, you might want to send it to someone else. To do this, the receiver needs to opt-in to the asset, have a minimum balance of 0.1 Algo (per asset opted-in), and sign with their private_key to confirm this. Then, the owner of the asset can transfer the asset to the receiver.

todo: add section/script on asset transfers?

Additional Resources

Footnotes

  1. As a disclaimer, the opinions expressed are solely my own and do not express the views or opinions of my employer. This is meant to be a short, fun, and somewhat insecure guide to NFTs for complete beginners in a hackathon setting.

  2. Note that in this tutorial, we care more about speed so we may do potentially unsafe stuff with your private key. If you are using real funds, make sure you are using kmd or some other secure way for storing your secrets.

  3. There are certain best practices when using IPFS because it is a decentralized store. If you are very serious about storing your image/data, you should pin the data against a machine that you also own in addition to relying on other machines.

  4. The more technical convention for NFTs, as described by EIP1155 or ARC-0003, is to have a link to your metadata JSON file here. But I've abstracted that layer away from this tutorial. A "NFT" is essentially a link to a JSON that contains a link to your data/image/file.

  5. On a more technical note, different blockchains have different block times and different finality times. Block time, imo, does not really matter compared to transaction finality times because the user only cares whether their transaction went through or not rather than individual blocks. According to this source, Ethereum has ~5 minute finality time, Solana is ~13s, Algorand is ~5s, while Avalanche is ~3s.

You might also like...
An NFTGenerator to generate NFTs and send them to nft.storage
An NFTGenerator to generate NFTs and send them to nft.storage

NFTGenerator Table of Contents Overview Installation Introduction Features Reflection Issues & bug reports Show your support Credits Overview The NFTG

Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot
Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot

Sunflower-farmers-auto-bot Sunflower Farmers NFT Game automated bot.IT IS NOT a

Irenedao-nft-generator - Original scripts used to generate IreneDAO NFTs

IreneDAO NFT Generator Scripts to generate IreneDAO NFT. Make sure you have Pill

This is a free python bot program that crosses you to farm with auto click in space crypto NFT game, having fun :) Creator: Marlon Zanardi
This is a free python bot program that crosses you to farm with auto click in space crypto NFT game, having fun :) Creator: Marlon Zanardi

🚀 Space Crypto auto click bot ready-to-use 🚀 This is a free python bot program that crosses you to farm with auto click in space crypto NFT game, ha

Using a Gameboy emulator and making it into a DIscord bot !

Gameboy-Discord Using a Gameboy emulator and making it into a Discord bot ! Im not the best at doing this, and i suck at coding so its completely unde

Telegram bot for making Heroku app.json by @AbirHasan2005

Heroku-app.json A Telegram bot for making Heroku app.json by @AbirHasan2005. Demo Bot Host Bot Deploy to Heroku Click Below Button to Deploy to Heroku

Ever wanted a dashboard for making your antispam? This is it.

Ever wanted a dashboard for making your antispam? This is it.

Morpheus is a telegram bot that helps to simplify the process of making custom telegram stickers.
Morpheus is a telegram bot that helps to simplify the process of making custom telegram stickers.

😎 Morpheus is a telegram bot that helps to simplify the process of making custom telegram stickers. As you may know, Telegram's official Sti

This is a unofficial library for making bots in rubika.

rubika this is a unofficial library for making bots in rubika using this library you can make your own0 rubika bot and control that those bots that ma

Owner
engineer @algorand
null
NFT Generator - A NFT Generator created using Python

NFT_Generator v1 An NFT Generator created using Python. This NFT Generation tool

null 3 Dec 2, 2022
NFT Generator: A modular NFT generator application

NFT Generator A simple passion project done with the role to learn a bit about h

null 2 Aug 30, 2022
A simple Discord bot wrote with Python. Kizmeow let you track your NFT project and display some useful information

Kizmeow-OpenSea-and-Etherscan-Discord-Bot 中文版 | English Ver A Discord bot wrote with Python. Kizmeow let you track your NFT project and display some u

Xeift 93 Dec 31, 2022
SOLSEA-NFT-EXPLORE - Using Streamlit to build a simple UI on top of the Solana API

SOLSEA NFT Explorer Using Streamlit to build a simple UI on top of the Solana AP

Devin Capriola 3 Mar 19, 2022
arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaplex Candy Machine.

arweave-nft-uploader arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaple

0xEnrico 84 Dec 26, 2022
A telegram bot to monitor the latest NFT price on BSC.

NFT_Monitor This is a telegram bot for monitoring price and ranking of NFT on Binance Smart Chain. Can fetch latest ranking and price in real time. .P

Niko Pang 10 Oct 9, 2022
Automatically render tens of thousands of unique NFT images individually as png's.

Blend_My_NFTs Description This project is a work in progress (as of Oct 24th, 2021) and will eventually be an add on to Blender. Blend_My_NFTs is bing

Torrin Leonard 894 Dec 29, 2022
Bulk NFT uploader to OpenSea!

Bulk NFT Uploader Description Simple easy peasy python script which logins to opensea account using metamask and bulk uploads NFT to your default coll

Lakshya Khera 25 May 23, 2022
This bot automaticaly access to giveaway ! You can won free NFT !

This bot automaticaly access to giveaway ! You can won free NFT !

2s.py 28 Oct 20, 2022
Automatically download any NFT collection from OpenSea.

OpenSea NFT Stealer The sole purpose of this script is to download any NFT collection from OpenSea. How does it work? Basically, the OpenSea website a

Dan 111 Dec 29, 2022