Pratham Prasoon Profile picture
Nov 21, 2021 15 tweets 5 min read Read on X
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 Prasoon

Pratham Prasoon 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

Feb 26
Hey Twitter!

I’m really excited to share what we’ve been working on at Eclipse for the past few months.

Here’s an Eclipse Mainnet 101 🧵 Image
@EclipseFND In 2010 Bitcoin became the first public blockchain that allowed for the transfer of digital currency.

In 2014 came Ethereum which built on Bitcoin’s foundation and added programmability of this digital currency with smart contracts. This allowed for the creation of dApps.
These smart contracts are programs that live on the blockchain and can used for things like
- Defi: Lending, borrowing and exchange protocols
- Real World Assets: Physical or tangible assets like real estate, commodities that can be tokenized
- Identity systems like ENS
Read 10 tweets
Jan 22, 2023
Twitter, forget JavaScript for a second. Take a look at Rust.

Rust developers are paid up to $230,000/year. There's insane demand for this tech!

Here's why and how I'm learning this beast of a programming language in 2023🧵
Python and JavaScript/TypeScript are my go-to languages for building web apps, backends, ML models, and anything I want.

However, recently I've wanted to learn something that's more low-level and faster.

That's how I got to learning Rust.
Rust is called by many the modern replacement for C++.

It is designed for systems programming, with a focus on safety, performance, and concurrency.

Here are some features of Rust that make it incredibly nice to work with:
Read 12 tweets
Jun 25, 2022
ROC curves are a topic that you will encounter at some point in your machine learning journey.

They are one the most important metrics for evaluating a model.

Let's how they work and how to use them 🧵 👇🏻
A new disease 'X' has been identified in a region, fatal enough to kill a patient if not treated.

A team of engineers develop a machine learning model to predict if someone has this disease or not, surprisingly it caught every infected person!

But there's a big problem...
You see, this is a special disease that affects only a very small group of people and the victims show no symptoms.

It is caused by several factors such as the amount of fat in someone's body, muscle density, etc.
Read 37 tweets
Jun 22, 2022
Google spent $36,847 an hour for 40 days straight to train a machine learning model called AlphaGo.

Put simply, making these models is an expensive and lengthy process.

Here's how you can potentially train your models upto 2x faster with the magic of parallelization🧵
Training a machine learning model is typically a 3 step process called 'ETL', which stands for:

- Extraction
- Transformation
- Loading

Let's take a closer look at these phases.
1/ Extraction

This is start of the machine learning pipeline where the raw data is extracted from wherever it is stored.

This data needs to be processed before it is fed into the model.
Read 15 tweets
Nov 27, 2021
A couple of days ago I showed you how to mint NFTs on the blockchain with JavaScript in ~10 lines of code.

You can do the same thing with Python 🐍

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 Python library, and with ~10 lines of code we'll mint NFTs without any hassle.

I'll guide you through the entire process, let's go 👇🏻
Read 14 tweets
Nov 20, 2021
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

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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(