Compare commits
20 Commits
79a3c6da81
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
5bb59c2273
|
|||
|
90d860278e
|
|||
|
262bfe9f43
|
|||
|
651392f91d
|
|||
|
7fe4212747
|
|||
|
00dbc7e3a9
|
|||
|
42bad18dfe
|
|||
|
2337ac8505
|
|||
|
c67c448088
|
|||
|
d22a9e3a0b
|
|||
|
e19c3f32d9
|
|||
|
787fd5c9df
|
|||
|
bde4bf10ff
|
|||
|
dd3b54d04e
|
|||
|
46d14fff87
|
|||
|
3956549437
|
|||
|
9df94a7aa5
|
|||
|
f78416f480
|
|||
|
025fd78388
|
|||
|
1b77e77ad3
|
@@ -0,0 +1,2 @@
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
Codes/Tutorials/Tutorial-4.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
@@ -0,0 +1,61 @@
|
||||
# Practical-1: MetaMask Installation and Ether Spending Study
|
||||
|
||||
## Step 1: Install MetaMask
|
||||
|
||||
### For Desktop (Browser)
|
||||
|
||||
1. Open your preferred browser (Chrome, Firefox, Edge, or Brave).
|
||||
2. Go to the official MetaMask website: [https://metamask.io](https://metamask.io)
|
||||
3. Click **"Download"** and select your browser.
|
||||
4. Add the extension to your browser.
|
||||
5. Open MetaMask, and follow the setup:
|
||||
- **Create a new wallet** or **import an existing one**.
|
||||
- Set a **strong password**.
|
||||
- **Backup your secret recovery phrase** securely.
|
||||
|
||||
### For Mobile
|
||||
|
||||
1. Go to your App Store (iOS) or Google Play Store (Android).
|
||||
2. Search for **MetaMask**.
|
||||
3. Download and install the app.
|
||||
4. Follow similar setup steps (create wallet, backup phrase).
|
||||
|
||||
## Step 2: Connect MetaMask to a Network
|
||||
|
||||
- By default, MetaMask uses the **Ethereum Mainnet**.
|
||||
- To use test networks for learning, click the network dropdown and select a testnet like **Goerli Test Network**.
|
||||
- Obtain free test Ether from a Goerli faucet: [https://goerlifaucet.com/](https://goerlifaucet.com/).
|
||||
|
||||
## Step 3: Understanding Ether Spending per Transaction
|
||||
|
||||
### Key Concepts
|
||||
1. **Gas Limit:** Maximum units of gas you are willing to spend.
|
||||
2. **Gas Price:** Price per gas unit in **Gwei** (1 ETH = 1,000,000,000 Gwei).
|
||||
3. **Transaction Fee = Gas Limit × Gas Price**
|
||||
|
||||
## Step 4: Make a Test Transaction
|
||||
|
||||
1. Ensure your wallet has ETH (test ETH on testnets).
|
||||
2. Click **Send** in MetaMask.
|
||||
3. Enter the recipient address and amount.
|
||||
4. Adjust **Gas Fee** if desired.
|
||||
5. Confirm the transaction.
|
||||
|
||||
## Step 5: Observe Spending
|
||||
|
||||
- After sending, MetaMask displays the **Transaction Fee** in ETH.
|
||||
- To see detailed info, check **Etherscan**:
|
||||
1. Copy the transaction hash from MetaMask.
|
||||
2. Go to [https://etherscan.io](https://etherscan.io) or testnet explorer like [https://goerli.etherscan.io](https://goerli.etherscan.io).
|
||||
3. Paste the hash to see gas used and ETH spent.
|
||||
|
||||
## Step 6: Experiment
|
||||
|
||||
- Send multiple transactions with different **gas prices**.
|
||||
- Observe how fees change based on **network congestion**.
|
||||
- Try interacting with **smart contracts** to see higher gas usage.
|
||||
|
||||
## Tips
|
||||
- Always use a testnet first to avoid losing real ETH.
|
||||
- MetaMask provides detailed transaction history and gas usage.
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# Practical-2: How to Create Your Own Wallet Using MetaMask for Crypto Transactions
|
||||
|
||||
MetaMask is a popular cryptocurrency wallet that allows you to manage Ethereum-based assets and interact with decentralized applications (dApps). Follow the steps below to create your own wallet.
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Install MetaMask
|
||||
|
||||
1. Go to the official MetaMask website: [https://metamask.io](https://metamask.io)
|
||||
2. Click on **"Download"**.
|
||||
3. Choose your platform:
|
||||
- **Browser Extension**: Chrome, Firefox, Brave, Edge
|
||||
- **Mobile App**: iOS or Android
|
||||
4. Install the extension or app.
|
||||
|
||||
---
|
||||
|
||||
## Step 2: Create a New Wallet
|
||||
|
||||
1. Open MetaMask.
|
||||
2. Click on **"Get Started"**.
|
||||
3. Select **"Create a Wallet"**.
|
||||
4. Set a **strong password** for local access. This password is used to unlock your wallet on your device.
|
||||
5. Click **"Create"**.
|
||||
|
||||
---
|
||||
|
||||
## Step 3: Backup Your Secret Recovery Phrase
|
||||
|
||||
1. MetaMask will display a **12-word Secret Recovery Phrase**. This is extremely important.
|
||||
2. Write it down on paper and **store it securely**.
|
||||
⚠️ **Never share your recovery phrase with anyone.**
|
||||
3. Confirm the recovery phrase by selecting the words in order.
|
||||
4. Click **"Confirm"**.
|
||||
|
||||
---
|
||||
|
||||
## Step 4: Access Your Wallet
|
||||
|
||||
1. Once confirmed, your wallet is ready.
|
||||
2. You can view your wallet address by clicking on **Account 1** at the top.
|
||||
3. This address can be shared to **receive crypto**.
|
||||
|
||||
---
|
||||
|
||||
## Step 5: Add Funds to Your Wallet
|
||||
|
||||
1. Buy crypto from an exchange (like Coinbase, Binance, or WazirX).
|
||||
2. Transfer it to your MetaMask wallet address.
|
||||
3. Wait for the transaction to be confirmed.
|
||||
|
||||
---
|
||||
|
||||
## Step 6: Use Your Wallet for Transactions
|
||||
|
||||
- **Send crypto:** Click **Send**, enter the recipient’s address and amount.
|
||||
- **Receive crypto:** Share your wallet address.
|
||||
- **Interact with dApps:** Connect MetaMask to decentralized applications by clicking **Connect Wallet** on supported websites.
|
||||
|
||||
---
|
||||
|
||||
## Step 7: Security Tips
|
||||
|
||||
- **Never share your password or Secret Recovery Phrase.**
|
||||
- Enable **two-factor authentication (2FA)** on exchange accounts.
|
||||
- Keep MetaMask updated to the latest version.
|
||||
- Consider using **hardware wallets** for storing large amounts of crypto.
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- [MetaMask Official Website](https://metamask.io)
|
||||
- [MetaMask User Guide](https://metamask.zendesk.com/hc/en-us)
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
contract BankAccount {
|
||||
mapping(address => uint256) private balances;
|
||||
|
||||
event Deposit(address indexed account, uint256 amount);
|
||||
event Withdraw(address indexed account, uint256 amount);
|
||||
|
||||
function deposit() public payable {
|
||||
require(msg.value > 0, "Deposit amount must be greater than 0");
|
||||
balances[msg.sender] += msg.value;
|
||||
emit Deposit(msg.sender, msg.value);
|
||||
}
|
||||
|
||||
function withdraw(uint256 amount) public {
|
||||
require(amount > 0, "Withdraw amount must be greater than 0");
|
||||
require(balances[msg.sender] >= amount, "Insufficient balance");
|
||||
|
||||
balances[msg.sender] -= amount;
|
||||
payable(msg.sender).transfer(amount);
|
||||
|
||||
emit Withdraw(msg.sender, amount);
|
||||
}
|
||||
|
||||
function getBalance() public view returns (uint256) {
|
||||
return balances[msg.sender];
|
||||
}
|
||||
}
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
contract StudentData {
|
||||
struct Student {
|
||||
uint256 id;
|
||||
string name;
|
||||
uint8 age;
|
||||
string course;
|
||||
}
|
||||
|
||||
Student[] private students;
|
||||
|
||||
event StudentAdded(uint256 id, string name, string course);
|
||||
event FallbackCalled(address sender, uint value, string message);
|
||||
|
||||
function addStudent(uint256 _id, string memory _name, uint8 _age, string memory _course) public {
|
||||
students.push(Student(_id, _name, _age, _course));
|
||||
emit StudentAdded(_id, _name, _course);
|
||||
}
|
||||
|
||||
function getStudent(uint256 index) public view returns (uint256, string memory, uint8, string memory) {
|
||||
require(index < students.length, "Invalid index");
|
||||
Student memory s = students[index];
|
||||
return (s.id, s.name, s.age, s.course);
|
||||
}
|
||||
|
||||
function getTotalStudents() public view returns (uint256) {
|
||||
return students.length;
|
||||
}
|
||||
|
||||
fallback() external payable {
|
||||
emit FallbackCalled(msg.sender, msg.value, "Fallback function triggered!");
|
||||
}
|
||||
|
||||
receive() external payable {
|
||||
emit FallbackCalled(msg.sender, msg.value, "Receive function triggered!");
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
# 410243: Blockchain Technology (BT)
|
||||
# 410243: Blockchain Technology (BCT)
|
||||
|
||||
This repository contains comprehensive resources for the Blockchain Technology course under the SPPU Computer Engineering syllabus (2019 pattern). It includes codes, handouts, notes, previous year questions (PYQs), and write-ups for assignments. The materials cover key topics such as blockchain fundamentals, cryptocurrency, smart contracts, consensus algorithms, and real-world applications. Additionally, it provides insights into the Ethereum platform using Solidity, enabling students to analyze and implement blockchain solutions effectively.
|
||||
|
||||
@@ -6,12 +6,29 @@ This repository contains comprehensive resources for the Blockchain Technology c
|
||||
|
||||
## Index
|
||||
|
||||
### Codes
|
||||
|
||||
> [!TIP]
|
||||
> Tutorials can be found in the [./Codes/Tutorials](./Codes/Tutorials/) directory.
|
||||
|
||||
1. [Code-1 (MetaMask Installation)](Codes/Code-1.md)
|
||||
2. [Code-2 (MetaMask Account Creation)](Codes/Code-2.md)
|
||||
3. [Code-3 (Bank Account)](Codes/Code-3.sol)
|
||||
4. [Code-4 (Student Data)](Codes/Code-4.sol)
|
||||
|
||||
### Notes
|
||||
|
||||
1. [Unit 1 - Mathematical Foundation for Blockchain](Notes/Unit%201%20-%20Mathematical%20Foundation%20for%20Blockchain)
|
||||
2. [Unit 2 - Feature Engineering](Notes/Unit%202%20-%20Feature%20Engineering)
|
||||
|
||||
### Codes
|
||||
### Assignments
|
||||
|
||||
1. Assignment-1:
|
||||
- [Questions](Assignments/BCT%20-%20Assignment-1%20%28Questions%29.pdf)
|
||||
- [Answers](Assignments/BCT%20-%20Assignment-1%20%28Answers%29.pdf)
|
||||
2. Assignment-2:
|
||||
- [Questions](Assignments/BCT%20-%20Assignment-2%20%28Questions%29.pdf)
|
||||
- [Answers](Assignments/BCT%20-%20Assignment-2%20%28Answers%29.pdf)
|
||||
|
||||
### Practical
|
||||
|
||||
@@ -20,6 +37,7 @@ This repository contains comprehensive resources for the Blockchain Technology c
|
||||
3. [Practical-3](Practical/Practical-3/)
|
||||
4. [Practical-4](Practical/Practical-4/)
|
||||
5. [Practical-5](Practical/Practical-5/)
|
||||
6. [Mini Project](Practical/Mini%20Project/)
|
||||
|
||||
### Question Papers
|
||||
|
||||
@@ -27,6 +45,7 @@ This repository contains comprehensive resources for the Blockchain Technology c
|
||||
- [END-SEM](Question%20Papers/END-SEM)
|
||||
|
||||
### [IN-SEM PYQ Answers](Notes/IN-SEM%20PYQ%20Answers)
|
||||
### [END-SEM PYQ Answers](Notes/END-SEM%20PYQ%20Answers)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user