0% found this document useful (0 votes)
11 views8 pages

BlockChain QB

The document outlines the fundamental elements of blockchain, including blocks, chains, nodes, ledgers, smart contracts, and consensus mechanisms, emphasizing their roles in decentralized and secure transactions. It also discusses the CAP theorem, cryptographic primitives, Base58 encoding, BIP-38 for encrypted private keys, and the process of Bitcoin transactions and wallets. Key features such as decentralization, immutability, and security are highlighted, along with the types of wallets available for storing Bitcoin.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

BlockChain QB

The document outlines the fundamental elements of blockchain, including blocks, chains, nodes, ledgers, smart contracts, and consensus mechanisms, emphasizing their roles in decentralized and secure transactions. It also discusses the CAP theorem, cryptographic primitives, Base58 encoding, BIP-38 for encrypted private keys, and the process of Bitcoin transactions and wallets. Key features such as decentralization, immutability, and security are highlighted, along with the types of wallets available for storing Bitcoin.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q) Elements of block chain

Ans) Decentralized computation & information sharing platform that enables multiple
authoritative domains, who do not trust each other, to co-operate, coordinate and collaborate in
a rational decision-making process. It is an open, distributed ledger that can record transactions
between two parties efficiently
Elements of blockchain: -
1) block: - container that store data, transaction data, hash of current block, hash of
previous block and timestamp, A block in a bitcoin Ram -> Paid -> Shyam-> 2BTC
2) Chain: - block are linked together using hashes BlK1 -> BlK2 -> BlK3
3) Nodes: - Computers that: - Store blockchain data, validate transactions, Participate in
consensus
4) Ledger: - Every node in blockchain network will maintain a ledger for all transactions.
Digital record book of all transaction. every node in the blockchain network will
maintain a ledger of all transactions, and the transactions will maintain the state of the
data that is being store on the blockchain network
5) Smart Contract: - It’s a self-executing code that automatically enforces, manages &
executes agreements when predefined conditions are met, removing the need for
intermediaries like lawyers or bank. e.g.: - If buyer sends 10 ETH and buyer's ID is
verified, then transfer car title to buyer and 10 ETH to seller.
6) Peer to Peer Network: - a broader term overarching the entire transactional flow which
serves to generate an agreement on the order and to confirm the correctness of the set
of transactions constituting a block.
7) Consensus network: - Uses consensus mechanism (algorithms) like Proof of Work
(PoW) or Proof of Stake (PoS) to enable decentralized nodes to agree on a single, valid
state of ledger.
8) Membership: Manages identity & transaction certificates as well as other aspects of
permissioned access.
9) Events: it creates notifications of significant operation on the blockchain (e.g. a new
block) as well as notifications related to smart [Link] does not include events
distribution
10) Wallet: it securely manages a user's security credentials. each user has a digital
certificate and is going to be performing transactions using the digital certificate there
needs to be a place where a user can securely store that private information
Features of Blockchain: -
1) Decentralization: Transferring control & decision making from a centralized entity to
a distributed network. e.g.: Bitcoin works without RBI or Banks.
2) Immutability: Once data is added, it cannot be changed. e.g.: WhatsApp message.
3) Transparency: All transactions are visible. e.g.: Anyone can check bitcoin transactions.
4) Security: Uses cryptography & consensus mechanisms. e.g.: Hackers cannot modify
millions copies at once.
5) Thrustless System: No need to trust individuals, trust systems. Example: Strangers can
transact safely without knowing each other.
Q) Cap theorem
Ans) CAP stands for Consistency, Availability and Partition Tolerance. For a distributed
system, the CAP Theorem states that it is possible to attain only two properties and the third
one would always compromise. The system requirements should define which two properties
should be chosen over the rest.
1) Consistency:
• It means that the duplicated data item will appear in the same copies on all nodes
during different transactions. An assurance that each node in a distributed cluster
returns the same, most recent and successful write.
• Every client's perception of the data must be consistent to be considered consistent.
• Sequential consistency, which is a particularly powerful type of consistency, is
referred to as consistency in CAP.
• e.g.: - Everyone/Everywhere data should be same. Movie tickets: A can see 2
tickets and B can see only one ticket (Inconsistent). I put 100 Rs in bank then I
checked it shows 0 rs.
2) Availability: - It means that all clients who request data receive a response even if one
or more nodes are down. In a distributed system, every operational node replies to each
valid request made to it, to put it another way. e.g.: - Server shouldn't be down, it always
response. Website should always be available unlike exam results website which is not
available / server is down.
3) Partition Tolerance: A communication breakdown, a momentary delay or lost connection
between nodes is referred to as a partition in a distributed system. Partition Tolerance describes
the ability of a cluster to function even in the face of numerous communication failures between
system nodes.
e.g.: - Even if networks fail, still system response something.

Working: -

CP (Consistency & Partition Tolerance): - Assume a node made changes so it will take time
to be available in other nodes. So, here availability is compromised so that data is consistent
e.g. Bank server doesn't be available bank website. Partition Tolerance will happen as if any
node stops its replica will come
AP (Availability & Partition Tolerance): - If I post something on social media it might take
time to reflect but it should be available to everyone.
CA (Consistency & Availability): - System should be centralized and 1 node will be there.
Data will be consistent & available but if only 1 server is there & it goes down there will be a
problem.
Q) Cryptographic primitives
Ans) Cryptographic primitives are used for building cryptographic protocols for a strong
secured network. Programmers develop new cryptographic algorithms with the help of
cryptographic primitives. They are an integral part of blockchain because of the following
reasons:
1. Security: To secure a transaction in the network or confidential information, strong
cryptography is required.
2. Encryption & Decryption: Used to develop encryption & decryption algorithms.
3. Validation: Validation of data is done with the help of digital signatures.
4. Specific: These are very specific in nature. It means one cryptographic primitive can
perform only one function.
Types of Cryptographic Primitives: -
1) One-way hash functions: A mathematical function used to encrypt variable length data
to fixed binary data. It’s a one-way function; you can't revert it back.
2) Randomized algorithms: These algorithms produce random ciphertexts for
encryption. It uses random values during execution to improve security and
unpredictability. e.g.: Shuffling of cards.
3) Mix Network: It breaks the flow of messages between the sender and the target. A mix
network hides who sent a message to whom by mixing messages from multiple users.
e.g.: Many people drop notes.
4) Retrieval of Private information: It is a protocol that allows the user to retrieve
information from the database. User can anonymously retrieve data without taking
permission. e.g.: Reading a book without knowing (the) librarian knowing which book
you read.
5) Initialization vector: It is a number (random value) that is used along with a key for
encryption and to prevent duplicate generation of cipher text. e.g.: Salt in cooking.
6) Symmetric Key Cryptography: A message is encrypted using a key and the same key
is used to decrypt the message. e.g.: Smart key locks & unlocks.
7) Asymmetric Key Cryptography: The public key is used to encrypt the message and
private key is used to decrypt where the private key is only accessible to the receiver.
e.g.: Post-box: anyone can put letters, only owner can open it.
Q) Base 58 (Encoding decoding all)
Ans) Bitcoin addresses use Base-58 encoding. Base 58 is a human-friendly binary-to-text
encoding that converts raw data (like wallet addresses) into compact, alphanumeric strings,
omitting confusing characters (0, O, 1, I) to prevent transcription errors.
Features: -
• Human Readable
• Avoids Ambiguity (0, O)
• Efficient
• Copy-paste Safe
• Leading zeros
Working
1. Binary Input: Takes raw binary data.
2. Conversion: Converts binary data to large integer.
3. Base Conversion: Repeatedly divides the integer by 58, using remainders to pick
characters from Base58 alphabet.
4. Result: Produces shorter, alphanumeric string.
The Base58 Alphabet: -
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
Excluded Characters (to avoid confusion): 0, I, O, l
Base58 Encoding: -
The majority of the data presented to users in bitcoin is encoded using Base58Check, making
it compact, simple to read, and straightforward to spot errors. The version prefix in
Base58Check encoding is used to create formats that are easy to tell apart

When encoded in Base58, these formats contain particular characters at the payload’s
beginning. These characters make it simple for people to recognize the kind of information that
is encoded and how to utilize it. This is what distinguishes, for instance, a bitcoin address
encoded with Base58Check that begins with a 1 from a private key WIF encoded with
Base58Check that begins with a 5
Base58 Decoding: - Shell scripts and command-line “pipes” that manipulate bitcoin keys,
addresses, and transactions are made simple by the Bitcoin Explorer commands. On the
command line, you can decode the Base58Check format with Bitcoin Explorer.
Q) Encrypted private keys (BIP 38)
Ans) In Bitcoin, the private key is the most important secret. Whoever has the private key owns
Bitcoin.
But what if: -
• Someone steals your private key?
• You want to store it on paper?
• You want extra protection with a password?
This is where BIP-38 comes into picture. BIP-38 (Bitcoin Improvement Proposal 38) defines
a standard method to encrypt a Bitcoin private key using a passphrase. Even if someone gets
the private key, they cannot use it without the password.
Why it is needed?
• Private Keys are long numbers.
• If stored as plain text — easy to steal.
• Paper wallets can be lost or photographed.
e.g.: - Your ATM card + Pin written on the same paper.
An encrypted private key is: -
• A private key locked with a password.
• Uses strong cryptographic algorithms.
• Can only be decrypted by entering the correct passphrase.
Password + Private Key = Encrypted private key
Working: - BIP-38 uses: -
• AES-256 encryption
• SHA-256 hashing
• Scrypt key derivation function
Scrypt makes brute-force attacks expensive and slow, even with powerful hardware.
e.g.: - safe that needs time + effort + correct combination.
Steps of Encryption: -
• Step 1: Choose a strong passphrase (long, random, hard to guess).
• Step 2: Derive Key using scrypt (Passphrase $\rightarrow$ encryption key).
• Step 3: Encrypt Private Key.
• Step 4: Encode using Base-58.
Result: - Encrypted private key usually starts with 6P
Types of BIP-38 Encryption: -
1. Non-EC-Multiply Mode
o Encrypts an existing private key.
o Simple password protection.
2. EC-Multiply Mode
o Private key generated from the password itself.
o Useful for generating wallets without exposing private keys.
e.g.: - non-EC: locking an existing suitcase. EC: Creating the suitcase itself from the lock.
Decryption
• Enter encrypted key.
• Enter passphrase.
• Private key is decrypted.
• Transaction is signed.
Wrong password = permanently lost Bitcoin
Q) Bitcoin transaction and wallet
Ans) When you send or receive bitcoin, this is called a transaction. To send a bitcoin, you input
the receiver’s address into your wallet application, then enter your private key and agree to the
transaction fee. After that, press the button that says “send.”
The receiver must then wait for the transaction to be verified by the mining network, which
can take up to 30 minutes as transactions are queued in a mining pool called the mempool. The
mempool is where transactions waiting to be verified are stored. The network typically
confirms a block of transactions every ten minutes; however, not all new transactions are
included in the newly created block.
All receivers can then collect their bitcoin. Afterward, both wallets display the updated balance
and the next transactions are processed.
Wallets & Addresses
Bob and Alice Both have bitcoins and "wallets" on their computer.
• Bob: A businessman who chooses to accept bitcoins as payment.
• Alice: A buyer who wants to buy things with bitcoins from Bob.
1) Creating a New Address: - Cryptographic Key Pair
Bob -> Bitcoin address -> $ Alice
• Bob creates a bitcoin address for Alice to send him payment.
• Users' bitcoin addresses are generated by bitcoin client software.
• The matching public key can be used to verify a message signed with a private key.
2) Submitting a Payment: - Alice informs her bitcoin client that she wants to send her bitcoins
to Bob’s address.
• The private keys for each of Alice's addresses are kept in her wallet.
• The public key can now be used by anyone on the network to confirm that the
transaction request is actually coming from the correct account owner.
• When receiving bitcoins, the public key is utilized.
3) Cryptographic Hashes: - A set of data is transformed by cryptographic hash functions into
an alphanumeric string of a predetermined length or hash value.

Input Data Hash Value

Cryptocurrency A81246023E3F6C6167A05BA2244090...

Cryptocurrency B0D8011285CF8B6752819949F0846E1B77F...

Cryptocurrency 9079F143929513596FA4125749960...
4) Nonces: - Bitcoin makes use of nonces to generate distinct hash values from the same data.
The hash value is drastically different when the nonce is changed. Although creating hashes is
a simple computational task, the Bitcoin system stipulates that the new hash value must have a
particular form, specifically a predetermined number of zeros.
Miners have no real way to foresee which nonce will deliver a hash esteem with the necessary
number of driving zeros. As a result, they are compelled to generate numerous hashes using
various numbers until they find one that works.
5) Miner Rewards: -A "Coinbase" transaction is included in each block. In this instance, the
winner (Gary) receives 50 bitcoins. Gary's wallet is updated with a new address for the
remaining bitcoins. Additionally, the miner receives payment for transactions sent by users.
The expense is a motivation for the excavator to remember the exchange for their block
6) Transaction Sequence: - The transaction is broadcast on the bitcoin network, where it is
validated by each participant and spread to nearly every node in the network. A mining node
verifies the transaction and records it in a block of transactions on the blockchain. After
transaction, the new owner can spend the transaction/bitcoin in a new transaction.
Concept of Wallet: - A Bitcoin wallet is a software or hardware tool that:
• Generates & stores private keys.
• Signs bitcoin transactions.
• Tracks balance using the blockchain.
• Backup & recovery.
Types of Wallets; -
1. Hardware wallets:
• Physical device that uses special-purpose hardware to run a secure, self-contained
bitcoin wallet.
• Store private keys offline. eg: USB drive with a safe inside. Even if the computer is
hacked, keys remain safe.
2. Paper wallets: - The keys that control bitcoin can also be printed and stored for a long time.
• Private key printed on paper.
• No digital copy.
3. Mobile Wallet: - The most prevalent kind of bitcoin wallet is the mobile wallet. These
wallets, which are compatible with smartphone operating systems like Android & iOS, are
frequently an excellent option for novice users.
4. Deterministic Wallet: - Keys derived from a single master key. Predictable structure.
5. Non-deterministic Wallet:
• Random key generation.
• Each key backed up separately.

You might also like