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.

Owner
engineer @algorand
Multi Account Generator Minecraft/NordVPN/Hulu/Origin And ...

Multi Account Generator Minecraft/NordVPN/Hulu/Origin And ...

76 Jan 01, 2023
This is a small package to interact with the OpenLigaDB API.

OpenLigaDB This is a small package to interact with the OpenLigaDB API. Installation Run the following to install: pip install openligadb Usage from o

1 Dec 31, 2021
🔮 A usefull set of scripts to dig into your Discord data package.

Discord DataExtractor 🔮 Discord DataExtractor is a set of scripts that allows you to dig into your Discord Data package. Repository guide ☕ Coffee_Ga

3 Dec 29, 2021
New developed moderation discord bot by archisha

Monitor42 New developed moderation discord bot by αrchιshα#5518. Details Prefix: 42! Commands: Moderation Use 42!help to get command list. Invite http

Kamilla Youver 0 Jun 29, 2022
HinamiRobot - Telegram Group Manager Bot Written In Python Using Pyrogram

✨ HINAMI CHAN ✨ Telegram Group Manager Bot Written In Python Using Pyrogram. Rea

DARK LEGEND088 2 Jan 27, 2022
⚡TIKTOK BOT - FAST OPTIMIZED ZEFOY SCRIPT

⚡ ZEFOY [ TikTok Zefoy Bot ] Get the script in: discord.gg/onlp !! Official shop: onlp.sellix.io Newest version v.9.0.0 Requirements pip install p

Tekky 186 Dec 31, 2022
[Fullversion]Web3 Pancakeswap Sniper bot written in python3.

🚀 Pancakeswap BSC Sniper Bot 🚀 Web3 Pancakeswap Sniper && Take Profit/StopLose bot written in python3, Please note the license conditions! The secon

21 Dec 11, 2022
Eva Maria Telegram Bot

Eva Maria Bot Features Auto Filter Manuel Filter IMDB Admin Commands Broadcast Index IMDB search Inline Search Random pics ids and User info Stats, Us

Eva Maria TG 477 Dec 31, 2022
Python client for the Datadog API

datadog-api-client-python This repository contains a Python API client for the Datadog API. The code is generated using openapi-generator and apigento

Datadog, Inc. 58 Dec 16, 2022
A tool for transferring server variable values from one intersect gamedata.db to another

Server Variable Transfer Tool Purpose This tool exists for use with the Intersect Engine (Ascension Game Dev GitHub). Its purpose is to UPDATE one sql

AVild 2 Oct 27, 2021
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 07, 2022
PyHoroscope - Observational Indian lunisolar calendar, horoscope and matching using the Swiss ephemeris

PyHoroscope Observational Indian lunisolar calendar, horoscope and matching usin

4 Jun 05, 2022
AminoAutoRegFxck/AutoReg For AminoApps.com

AminoAutoRegFxck AminoAutoRegFxck/AutoReg For AminoApps.com Termux apt update -y apt upgrade -y pkg install python git clone https://github.com/deluvs

3 Jan 18, 2022
A Simple Telegram Inline Torrent Search Bot by @infotechIT

Torrent-Search-RoBot A Simple Telegram Inline Torrent Search Bot by @infotechIT. Torrent API Using api.infotech.wtf API Host Bot Deploy to Heroku Clic

InfoTech 0 May 05, 2022
Import Notion Tasks to

Notion-to-Google-Calendar (1 way) Import Notion Tasks to Google Calendar NO MORE UPDATES WILL BE MADE TO THIS REPO. Attention has been put on a 2-way

12 Aug 11, 2022
Network simulation tools

Overview I'm building my network simulation environments with Vagrant using libvirt plugin on a Ubuntu 20.04 system... and I always hated how boring i

Ivan Pepelnjak 219 Jan 07, 2023
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time

Naufal Ardhani 59 Dec 04, 2022
Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon.

Stork (pleroma-bot) Mirror one or multiple Twitter accounts in Pleroma/Mastodon. Introduction After using the pretty cool mastodon-bot for a while, I

73 Jan 08, 2023
AWS Workmail Migration Tool

WMigrate A tool for migrating AWS Workmail Users and Groups cross region and cross accounts. It also creates user and group aliases and adds the users

NK 1 Oct 27, 2021
A battle-tested Django 2.1 project template with configurations for AWS, Heroku, App Engine, and Docker.

For information on how to use this project template, check out the wiki. {{ project_name }} Table of Contents Requirements Local Setup Local Developme

Lionheart Software 64 Jun 15, 2022