Web 3
Web 3
Goal
To create a Cohort of people who are great at Blockchains, Web3.
My background in Web3
Detailed video -
Started working in Sept 2022. Worked at ~3 companies since. Primarily worked at Wallets,
Exchanges and Gambling websites.
Easy -
Hard -
1. - Harkirat Singh
2. - Led by @cb7chaitanya, mentored by Harkirat
If you want to propose a project, please build a v1 for the Superteam hackathon and we can
sponsor it further
6. RPC aggregator - Let a user put in a bunch of RPCs from various providers (Helius, Alchemy,
QuickNode) and you should figure out which one to forward requests to (Similar to
)
8. Youtube channel opinions market - Let people trade on a coin associated to a Youtube
channel. Creator can come and collect royalties by connecting their YT account.
9. Tiplink (even tho we’re building it saparately, if you want to build a better version with a twist,
you should do it)
10. Github Bounty Dispenser. Make users give their Adhar/Pan. Make users link their github with
their wallet address. Allow maintainers to approve bounties. Create a dashboard where you
can track profiles of users/companies and a leaderboard of contributors based on bounty
earned
4 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Silicon valley collapsed in 2022. I was in the US when it happened. Most YC companies had their
funds in SVB. They were bailed out, but if not, you would’ve seen a lot of startups die.
Bailouts
The 2008 Financial crisis was triggered by a financial instrument called mortgage-backed
securities.
Even though the banks at Wall Street were at fault, the government ended up bailing them out
using Taxpayer money.
5 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
1. JPY
6 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Even if I do issue a Kirat coin , no one would use it, and for good reasons -
2. I become the central mint and verification athority for the coin.
7 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Intro to hashing
Hashing is a process that transforms input data (of any size) into a fixed-size string of characters.
1. Deterministic: The same input will always produce the same output.
2. Fast computation: The hash value can be quickly computed for any given data.
8 of 17 02-08-2024, 20:46
3. Pre-image resistance: It should be computationally infeasible to reverse the hash function
(i.e., find the original input given its hash output).
4. Small changes in input produce large changes in output: Even a tiny change in the input
should drastically change the hash output.
5. Collision resistance: It should be computationally infeasible to find two different inputs that
produce the same hash output.
SHA-256
Lets try out a famous hash function, SHA-256 here -
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
console.log(hash)
10 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Assignment #1
What if I ask you the following question — Give me an input string that outputs a SHA-256 hash
that starts with 00000 . How will you do it?
A: You will have to brute force until you find a value that starts with 00000
Node.js code
// Function to find an input string that produces a hash starting with '00000'
function findHashWithPrefix(prefix) {
let input = 0;
while (true) {
let inputStr = input.toString();
let hash = crypto.createHash('sha256').update(inputStr).digest
if (hash.startsWith(prefix)) {
return { input: inputStr, hash: hash };
}
input++;
}
}
11 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Assignment #2
What if I ask you that the input string should start with 100xdevs ? How would the code
change?
Node.js code
// Function to find an input string that produces a hash starting with '00000'
function findHashWithPrefix(prefix) {
let input = 0;
while (true) {
let inputStr = "100xdevs" + input.toString();
let hash = crypto.createHash('sha256').update(inputStr).digest
if (hash.startsWith(prefix)) {
return { input: inputStr, hash: hash };
}
input++;
}
}
12 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
Assignment #3
What if I ask you to find a nonce for the following input -
Node.js code
// Function to find an input string that produces a hash starting with '00000'
function findHashWithPrefix(prefix) {
let input = 0;
while (true) {
let inputStr = `
harkirat => Raman | Rs 100
Ram => Ankit | Rs 10
` + input.toString();
let hash = crypto.createHash('sha256').update(inputStr).digest
if (hash.startsWith(prefix)) {
return { input: inputStr, hash: hash };
}
input++;
}
}
13 of 17 02-08-2024, 20:46
Assignment #4
Lets explore
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
3. Timestamp server
4. Proof of work
15 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
5. Network
6. Incentive
16 of 17 02-08-2024, 20:46
DailyCode https://projects.100xdevs.com/pdf/web3-orientation/Web3-Cohort---Ori...
17 of 17 02-08-2024, 20:46