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
Unofficial YooMoney API python library

API Yoomoney - unofficial python library This is an unofficial YooMoney API python library. Summary Introduction Features Installation Quick start Acc

Aleksey Korshuk 136 Dec 30, 2022
Deepak Clouds Torrent is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.

Deepak Clouds Torrent is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.

Deepak Clouds 37 Oct 28, 2022
Бот Telegram для Школы в Капотне (ЦО № 1858)

co1858 Telegram Bot Активно разрабатывался в 2015-2016 году как учебный проект, с целью научиться создавать ботов для Telegram. Бот автоматически парс

Ilya Pavlov 4 Aug 30, 2022
Python3 library that can retrieve Chrome-based browser's saved login info.

Passax EDUCATIONAL PURPOSES ONLY Python3 library that can retrieve Chrome-based browser's saved login info. Requirements secretstorage~=3.3.1 pywin32=

Auax 1 Jan 25, 2022
Check your bot status automatically using userbot, simply and easy

Status Checker Userbot check your bot status automatically using userbot, simply and easy. Mandatory Vars API_ID : Telegram API_ID, get it from my.tel

ALBY 6 Feb 20, 2022
Bitstamp API wrapper for Python

NOTICE: THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED It is highly unlikely that I will respond to PRs and questions about usage. This library was

Jack Preston 53 Mar 09, 2022
This is a music bot for discord written in python

this is a music bot for discord written in python, it is designed for educational use ONLY, I do not take any responsibility for uses outside of educational use

5 Dec 24, 2021
Telegram Google Translater Bot Can Translate Any Language To Your Selected Language

🔰 TELEGRAM GOOGLE TRANSLATER 🔰 • ⚡ INSTALLING ⚡ • • ✅ OFFICIAL SUPPORTS ✅ •

⚝ANKIT KUMAR⚝ 2 Jan 16, 2022
(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

3 Jun 04, 2021
Apex lets you build, deploy, and manage AWS Lambda functions with ease.

No longer maintained This software is no longer being maintainted and should not be chosen for new projects. See this issue for more information Apex

Apex 25 Dec 23, 2022
Read manga from your favourites websites on telegram.

tg-manga-bot Read manga from your favourites websites on telegram. Current Development Bot @idkpythonbot Telegram Channel tg_manga_bot Commands start

Daniel Rivero 41 Dec 22, 2022
Easy and simple, Telegram Bot to Show alert when some edits a message in Group

Edit-Message-Alert Just a simple bot to show alert when someone edits a message sent by them, Just 17 Lines of Code These codes are for those who incu

Nuhman Pk 6 Dec 15, 2021
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

URL Uploader Bot An Open Source ALL-In-One Telegram RoBot, that can do lot of things. My Features Installation The Easy Way You can also tap the Deplo

NT BOTS 1 Oct 23, 2021
Powerful Telegram Members Scraping and Adding Toolkit

🔥 Genisys V2.1 Powerful Telegram Members Scraping and Adding Toolkit 🔻 Features 🔺 ADDS IN BULK[by user id, not by username] Scrapes and adds to pub

The Cryptonian 16 Mar 01, 2022
Bot made by BLACKSTORM[BM] Contact Us - t.me/BLACKSTORM18

ᴡʜᴀᴛ ɪs ᴊᴀʀᴠɪs sᴇᴄᴜʀɪᴛʏ ʙᴏᴛ ᴊᴀʀᴠɪs ʙᴏᴛ ɪs ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴍᴀɴᴀɢᴇʀ ʙᴏᴛ ᴡɪᴛʜ ᴍᴀɴʏ ғᴇᴀᴛᴜʀᴇs. ᴛʜɪs ʙᴏᴛ ʜᴇʟᴘs ʏᴏᴜ ᴛᴏ ᴍᴀɴᴀɢᴇ ʏᴏᴜʀ ɢʀᴏᴜᴘs ᴇᴀsɪʟʏ. ᴏʀɪɢɪɴᴀʟʟʏ ᴀ

1 Dec 11, 2021
Python powered spreadsheets

Marmir is powerful and fun Marmir takes Python data structures and turns them into spreadsheets. It is xlwt and google spreadsheets on steroids. It al

Brian Ray 170 Dec 14, 2022
The world's first public V2ray manager Telegram bot

📌 DarkV2ray-Manager-Bot 0.1 UPDATE 11/11/2021 Telegram bot v2ray Test user expired date data limit paylode && sni usage user on/off heroku bot hostin

@Dk_king_offcial 1 Nov 11, 2021
Crosschat - A bot for cross-server communication

CrossChat A bot for cross-server communication. Running the bot To run the bot y

8 May 15, 2022
Some python code to make twitter bots ;)

How to set up a twitter bot using python's tweepy library Create a twitter developer account and project Make sure you are logged into your twitter ac

Wael 2 Jan 10, 2022
The gPodder podcast client.

___ _ _ ____ __ _| _ \___ __| |__| |___ _ _ |__ / / _` | _/ _ \/ _` / _` / -_) '_| |_ \ \__, |_| \___/\__,_\__,_\___|_| |_

gPodder and related projects 1.1k Jan 04, 2023