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
tgEasy's Official Assistant Bot and Example Bot

tgEasy Assistant The assistant bot that helps people with tgEasy directly on Telegram. This repository contains the source code of @tgEasyRobot and th

Divide Projects™ 4 Dec 26, 2022
Spacecrypto-bot - SpaceCrypto Bot Auto Clicker

SpaceCrypto Auto Clicker Bot Também fiz um para Luna Rush ( https://github.com/w

Walter Discher Cechinel 5 Feb 22, 2022
A telegram media to pixeldrain stream link bot

Pixeldrain-Bot A telegram media to pixeldrain stream link bot Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - ht

Fayas Noushad 11 Oct 21, 2022
Powerful Ethereum Smart-Contract Toolkit

Heimdall Heimdall is an advanced and modular smart-contract toolkit which aims to make dealing with smart contracts on EVM based chains easier. Instal

Jonathan Becker 69 Dec 26, 2022
A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier

Amazon Web Services - Labs 1.9k Jan 07, 2023
A comand-line utility for taking automated screenshots of websites

shot-scraper A comand-line utility for taking automated screenshots of websites For background on this project see shot-scraper: automated screenshots

Simon Willison 837 Jan 07, 2023
Drover is a command-line utility for deploying Python packages to Lambda functions.

drover drover: a command-line utility for deploying Python packages to Lambda functions. Background This utility aims to provide a simple, repeatable,

Jeffrey Wilges 4 May 19, 2021
Telegram bot/scraper to get the latest NUS vacancy reports.

Telegram bot/scraper to get the latest NUS vacancy reports. Stay ahead of the curve and don't get modrekt.

Chee Hong 1 Jan 08, 2022
BiliBili-live-barrage-transceiver - A simple python program for sending and receiving barrage in bilibili live room

BiliBili-live-barrage-transceiver - A simple python program for sending and receiving barrage in bilibili live room

zeroy 2 Jan 18, 2022
A very simple Salesforce.com REST API client for Python

Simple Salesforce Simple Salesforce is a basic Salesforce.com REST API client built for Python 3.5, 3.6, 3.7 and 3.8. The goal is to provide a very lo

simple salesforce 1.4k Dec 29, 2022
A supabase client for python

supabase-client A Supabase client for Python. This mirrors the design of supabase-js Full documentation: https://keosariel.github.io/2021/08/08/supaba

kenneth gabriel 11 Dec 19, 2022
pokemon-colorscripts compatible for mac

Pokemon colorscripts some scripts to print out images of pokemons to terminal. Inspired by DT's colorscripts compilation Description Prints out colore

43 Jan 06, 2023
Python SDK for IEX Cloud

iexfinance Python SDK for IEX Cloud. Architecture mirrors that of the IEX Cloud API (and its documentation). An easy-to-use toolkit to obtain data for

Addison Lynch 640 Jan 07, 2023
This Server Cloner can clone the server you want with all the perms of roles in every particular channel.

Server-Cloner-with-perms 🚀 This Server Cloner can clone the server you want with all the perms of roles in every particular channel. Features Clone C

Gripz 0 Feb 17, 2022
Discord Selfbot, 90+ commands

Setting the bot up. STEP 1: copy the directory yook.club selfbot was downloaded and extracted into, open cmd and type "cd " then paste. STEP 2: python

yook 1 Dec 12, 2021
Telegram vc userbot

Telegram Vc Userbot Available Commands /ping :- To check whether userbot is up or not /joinvc :- To join vc /leavevc :- To leave vc /join_group :- To

NandyDark 7 Nov 18, 2022
Security Monkey monitors AWS, GCP, OpenStack, and GitHub orgs for assets and their changes over time.

NOTE: Security Monkey is in maintenance mode and will be end-of-life in 2020. For AWS users, please make use of AWS Config. For GCP users, please make

Netflix, Inc. 4.3k Jan 09, 2023
Apprise - Push Notifications that work with just about every platform!

ap·prise / verb To inform or tell (someone). To make one aware of something. Apprise allows you to send a notification to almost all of the most popul

Chris Caron 7.2k Jan 07, 2023
this is a telegram torrent bot

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

AYUSH 237 Dec 16, 2021
Best badge generator API to count visitors of your Repository / Account 🥇

github visitors badge A badge generator service to count visitors of your markdown file. Hello every one! In this post, I will tell you the story of m

Sᴇɴᴜ Gᴀᴍᴇʀ Bᴏʏ 〽 3 Dec 11, 2021