You make your own cryptocurrency on the blockchain with JavaScript in just these 9 lines of code.

Here's how it works🧵
We'll be using thirdweb's JavaScript sdk to make this happen.

To start you'll need to setup Metamask and store your private key, here's a guide that'll take you through the entire process.

🔗 thirdweb.com/portal/guides/…
Next head over to thirdweb.com/start, you will be guided through a setup process.

These steps are to get your metamask setup with the thirdweb interface.
These steps are for choosing the chain network, we'll go with the rinkeby testnet.

Our currency will be minted on this "fake" test network called rinkeby for free.
Now we can create the project to which we'll be adding the NFT module to create our own currency 🤑
Adding the Token module, some details... and ther you go!

We actually can now mint our currency straight from the dashboard.

But we don't do that, we're JavaScript programmers.
Make sure you copy the "module address" from the previous step which we'll use in the code.

Just click on the pill and it'll copy it for you.

Now onto the code.
Using these commands we'll install the thirdweb sdk and the types library.

Additionally you can install TypeScript if you want to.
We'll import the thirdweb library and ethers js for connecting our wallet and also import the private key that you should remember from the metamask guide.

Remember to store your private key safely and do not share them with anyone.
We will now instantiate the sdk, add our private key and connect to the blockchain.
Now can add the module address from the dashboard and the finally use it to mint our currency.

This piece of code mints 1000 Pratham coin, notice how we `ethers.utils.parseUnits("1000",18)` instead of just passing '1000'.

Here's why...
Transactions on the blockchains are incredibly precise, upto 18 decimals.

Passing 1 as the amount would not mint 1 Pratham coin but instead mint 0.000...18 zeros...1, to compensate for this we use ethers here.

The number being passed it 1000 x 10^18 = 1000 for the blockchain
Also, we cannot simple use the regular `1000 * (10**18)` math expression in JavaScript because Js is capped to 2^64 - 1 numbers.

Solidity which is on the backend of thirdweb is capped to 2^256 -1 numbers.

tldr; Js cannot handle big numbers, which is why we use ethers.
Now looking at the dashboard you'll see that our cryptocurrency has been minted.

Congrats, now its time to use it 😉

If you liked this thread make sure you retweet it and follow @PrasoonPratham
Want to read this thread later?

Save it as a link and you'll find lots of other awesome web3 content on our portal.

thirdweb.com/portal/guides/…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Pratham

Pratham Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @PrasoonPratham

20 Nov
Get started with web3 development on the blockchain today! ⛓

Here's a simple 5 minute guide to setup your metamask wallet and get free ethereum to develop decentralised applications 🧵
The first step is to head over to metamask.io/download, then download the metamask browser extention for your specific browser.

Chrome, FireFox and any chromium dervatives like brave, edge, vivaldi are supported.
After the extention is installed you'll be at the setup screen, click continue.
Read 13 tweets
19 Nov
You can mint an NFT on the blockchain in JavaScript with ~10 lines of code.

No solidity, no testing... just these 10 lines of JavaScript.

Here's how it works 🧵
Typically minting an NFT would require you to write code in this language called 'solidity' to create a smart contract which would then mint the nft.

It require lots of testing, security checks and remember, once code goes on the blockchain it cannot be changed.

This sucks.
What we'll do instead is use the thirdweb's JavaScript library, and with 7 lines of code we'll mint NFTs without any hassle.

I'll guide you through the entire process, let's go 👇🏻
Read 15 tweets
6 Nov
As I see it, there are three fundamental features of a blockchain:

🧊Decentralisation
🕵️‍♂️Transparency
🔐Immutability

They make the blockchain so powerful and useful.
1️⃣Decentralisation

All data is decentralised and not stored in some server at a billon dollar corporation.

Everyone gets to own the data.
2⃣ Transparency

Since everyone owns the data, it can viewed by everyone.

A lot of people think the blockchain keeps people anonymous, which is incorrect.

They are actually "pseudonymous".

Anonymous: not identifiable
Pseudonymous: identifiable under and alias
Read 4 tweets
5 Nov
You wouldn't believe this, a friend of mine is earning $100k+ a year by writing code for something called a 'DAO'.

They are one of the most interesting applications of blockchain tech in web3 and are being used for a host of different things.

Here's how it works 🧵
🏢'DAOs short for (𝗗ecentralized 𝗔utonomous 𝗢rganizations) are an effective and safe way to work with like-minded folks around the globe.'

- Ethereum.​org

🔺Corporations of today operate with a 'hierarchical' structure so to speak.
The people at the top hold an immense amount of power, which they can use to their own advantage.

Granted there are laws and rules to prevent this, but they aren't always enforced.

There's always room for shady things like insider trading or manipulating the books to happen.
Read 14 tweets
1 Oct
Want to learn Python as a beginner in 2021 for free?

Here's everything you need to know to get started with updated resources and a proper roadmap!

🧵 👇🏻
A bit of backstory, I wrote my first piece of Python code in 2015 but eventually gave it up for several years because of two main reasons:

A. I had no internet
B. No guidance

You have the power of the internet and I don't want the same to happen to you, hence this guide.
All of this is based on my experience of successfully teaching 300+ students the basics of how to code using Python.

Feel free to modify this roadmap to your liking!

Now onto the guide.
Read 22 tweets
29 Sep
Hi 👋 if you are interested in:

🐍 Python
📈 Data Science
🤖 Machine Learning
🐼 pandas

Follow me. ✔️

I'm planning on using Twitter to share a lot of content that you won't want to miss. 🎉
👽👌
The twitter algorithim is a joke😂

I'll explain what happened sometime soon, this went pretty unexpected.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Thank you for your support!

Follow Us on Twitter!

:(