https://animagraffs.com/how-cryptocurrency-works
The Proof of work is nothing but computing an hash which start with some number of zeroes(changes time to time) but the input of the hash function should be in format of {prefix} + hashThatNeededToCompute + {naunce}
You can change the transaction of your own blockchain as the network get forks
lets take and example. A send 100 bitcoins to B and, B sees the crypto is received in wallet and give A drugs (A need drugs). Now A after receiving drugs from B might go and edit his own Blockchain hash (Only A has authority to edit his transaction as it is signed) and set the transaction amount to 0 hoping the bitcoin he spend comes back.
But here is the point when you exchange crypto the decentralize exchange will no immediately let you use the crypto instantly it will be like we tracked your transaction and it seems succesfull and we can see the block got also created but wait for next 64 blocks to be get added on chain then you can use your money as there are changes of forks getting created of the blockchain
Disclaimer: The editing is only possible if it is the last block (latest block created) on chain and it is only possible the transaction initiator to edit as it is signed (In Wazirx hack one of the core team private keys got hacked)
Hierarchical Deterministic (HD) Wallets
Introduced from BIP-39 proposal. You rather remembering all the public and private keys of account you can just remember the seed phrase and can generate the accounts which are associated with that seed phrase wrt to the derived address
Now lets us say you have two accounts in phantom wallet with names sadiq1 and sadiq2 with 1 sol and 2 sol respectively. Now if you reboot the system and install phantom wallet again and start setting up you will see import from seed phrase you can import and click on find accounts (don’t panic if you find only one account) and select and move on. Let’s say you have find only one account with 1 sol now you can click on create account in the new wallet it will automatically bring the other account with 2 sol as it was before. One thing to remember is the account names will not persist so don’t panic if the accounts name are different just identify the different accounts with their amounts
Note: Sometimes the account created might not have the amount you’re desiring this may be due to different wallets store accounts sequence in different order thus keep creating accounts you will ultimately should find your account with money
Token
Rather creating a own blockchain some cryptos like USDC, PEPE, USDT (Tether) create on the existing blockchains like Ethereum and Solana they are called tokens. In Eth they are made using Smart contracts in Solana they are made using Accounts FYI.
Thus here when took example of Solana the accounts created have ability to mint the new tokens and kept in Associated Token Accounts from the main account of created token which is created from the main account of Solana
Now to store the newly minted token in the Associated Token Account you should have some amount of the main blockchain crypto (for example you need to have some sol if you want to store an token created by solana) as Rent
USDC is an example of tokenizing an Real world asset which are back by an real world entity/commodity
Multi-Party Computation
In chrome extensions the private keys are encrypted with wallet password and stored in our system locally
But this isn’t the best approach
Here are some approaches:
- Encrypt the private key in Database - This is good but if database and backend is hacked, bro we screwed up
- Sharding - breaking the key into parts and storing in it multiple databases, but here if the hacker got access to backend then he can get the secrets
- Shamir secrets - This is a way to break the private key into multiple parts and hash them using Shamir secrets and store it in multiple databases. It’s a good approach but if the hacker is able to get access of most of the databases. then he can brute force and get the whole private key
- Multisighs - This is fairly good approach like, both platform and the user should sign the transaction to go into. but as happened in many scams, most people hack the frontend of the Multisighs, but it is fairly and good approach. Most companies use it, but there will be some inconsistencies, like if the user want to migrate to another platform then he need to transfer all the funds to another account as platform cannot give it’s private key
- Multi-Party Computation (MPC) - It enables multiple parties – each holding their own private data – to evaluate a computation without ever revealing any of the private data held by each party (or any otherwise related secret information).
This is the best approach as even if the backend or frontend or even one of the server got hacked still they cannot hack the private key
Multi-Party Computation (MPC) in Web3 is a cryptographic technique that allows multiple parties to compute something together without revealing their private inputs to each other. Think of it as solving a puzzle together where everyone contributes a piece, but nobody sees anyone else’s pieces - yet you still get the correct final answer.
Here’s how it works in simple terms:- Secret Sharing: Each participant splits their private data into pieces and distributes these pieces among all participants.
- Joint Computation: Everyone performs calculations on these pieces without ever reconstructing the original data.
- Result Assembly: The final result is assembled from everyone’s calculations, revealing only the output, not the individual inputs.
Authority in Blockchain
Authorities are accounts which have access/authority/power to make changes in the Program. Like Mint Authority can mint more tokens, freeze authority can freeze the money of accounts which have tokens
Q Then where is the decentralization ???. If people are able to manipulate, block our money ??? A Most of the tokens don’t have Mint and freeze authority. Some tokens like USDC have it that’s it.
-
Q Let’s say you have two chains (Chain 1 and Chain 2) competing, and Chain 1 wins, what happens to the transactions in Chain 2, as both chains may not have the exact same transactions?
Example:
Chain 1 has block 1 with transaction T1, T2 and T3.
Chain 2 has block 2 with transactions T4, T5 and T6.
Then what happens to T4, T5 and T6 when Chain 2 gets rejected? -
A Unconfirmed Transactions in a Blockchain Network are stored in a Data Structure called Mempool which like the Blockchain itself every node participating in the Blockchain Network has a “Copy” or to be more specific Instance of Blockchain and Mempool. Miners take the Transactions from the Mempool and Mine new blocks which are then broadcasted to the network. Coming back to the question what happens to the Orphaned Transactions of the Rejected Chain is that those Transactions are returned back to the Mempool to be Mined again to create a New Block in the Blockchain.
-
Q How can we buy crypto without getting in eyes of government
-
A Buy crypto from a centralized exchange (let’s assume eth) ⇒ Send it over to an anonymizer or mixer for say tornado-cash ⇒ After 100 days pull it out from other eth address ⇒ Go to a cross chain protocol like wormhole and convert it to bitcoin To know more about tornado-cash: https://bitquery.io/blog/tornado-cash
-
Q Why most wallets are extensions
-
A Being extensions give them ability to inject some code in every website. applications being connecting the wallet with the decentralize exchange. most of the extensions expose an object in window class like go to browser console and type
window.phantomorwindow.backpack -
Q what if while broadcasting the transaction to the minors around the world fails and some minors only receive the block and other didn’t
-
A even if some minors didn’t receive the transaction the blockchain continues but when the minors receive next transaction then the previous hash doesn’t match thus the minors request the other minors for the block that didn’t transmit and add it
-
Q what if the first block of the blockchain get’s manipulated
-
A one person compute <<< many peoples compute around the world thus no one will accept the small block all of the people will go around the big one
even though person tried to make an longest blockchain he can’t as people mine around the world continuously -
Q how to find an user on blockchain
-
A take help of companies like https://chain.link/ and track the persons transactions and figure out. One hack if he got registered in some centralized exchange ask them about his KYC
-
Q where do web3 browser extensions wallets store our keys
-
A they store it in out browser itself safely which cannot be accessed without using the wallet password
-
Q In comments we see an scam goes like “Hey i have 200USDT in my account of seed phrase { their 12 words seed phrase }”
-
A Thus here as to pull out account we need to pay some gas. As USDT is build upon sol and eth we need to send some sol to the account to pull it out. Here they will take that sol account and that’s how you are scammed
-
Q What is difference between Transactions and Instructions ?
-
A Transaction is basically sending Instructions to Blockchain. A transaction can have one or more Instructions
-
Q How liquidity pool have so much crypto lying around to work ?
-
A They take some asset while transaction like if we are converting from SOL to ETH we need to contribute some SOL amount to the liquidity pool
-
Q Difference between USD, USDC, USDT ?
-
A - USD - official US currency - USDC - own by a company called
circlewhich mint USDC coins and they store collateral amount of USD minted - USDT (Tether) - first and largest stable coin by market cap, issued by Tether Limited, Claims to be backed 1:1 by USD and other assets (including commercial paper)