Techhunter
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    5
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Understanding Ethereum Transactions and Its Consensus Algorithm We can’t talk about Ethereum transactions without talking about Ethereum, so what is this *Ethereum*? Ethereum is also known as "the world computer" But why is it called that? It’s called "**the world computer**" because any program can run on Ethereum. Ethereum is a network of computer all over the world that follows a set of rules called **Ethereum Protocols**. The **Ethereum protocol** is a comprehensive set of rules and standards that govern the Ethereum blockchain network. It defines how nodes in the network communicate, validate transactions, and maintain the distributed ledger. ## Ethereum Transaction ##### What is a transaction? Transactions are cryptographically signed order or requests from accounts. An account will initiate a orders to update the state of the Ethereum network. The simplest order is transferring ETH from one account to another. #### What is a Ethereum transaction? Ethereum transaction are request initiated by the owner of the ethereum account. Note: It is not a smart contract *Example*: Mr David Nnamdi send Techhuter 0.3 ETH, Mr David's account must be debited while Techhunter's account must be credited. State-changing occurs in transaction and this state will be broadcasted on the whole network. Any node that broadcast a request for a transaction to be executed on the EVM (Ethereum Virtual Machine); after this happens, a validator will execute the transaction and propagate the resulting state change to the rest of the network. These transactions can be seen on the etherscan.io. ![image](https://hackmd.io/_uploads/H1j_1-V_C.png) ###### Transaction details includes: - **From:** The address of the sender, who will be signing the operation. This will be an externally-owned account, as contract accounts cannot initiate operations. - **To:** The receiving address. If it's a contract account, the operation will execute the contract's code. - **Signature:** The sender's identifier, created when the sender's private key signs the operation, verifying that the sender has authorized it. - **Nonce:** A sequential counter that indicates the transaction number from the account. - **Value:** The amount of ETH to be transferred from the sender to the recipient, expressed in WEI (where 1 ETH equals 1e+18 WEI). - **Input Data:** An optional field for including arbitrary data. - **Gas Limit:** The maximum number of gas units that the operation can consume. The EVM specifies the gas required for each computational step. - **maxPriorityFeePerGas:** The highest price per gas unit that can be given as a tip to the validator. - **maxFeePerGas:** The maximum fee per gas unit that the sender is willing to pay for the operation, including both tbaseFeePerGas and maxPriorityFeePerGas. ![Screenshot 2024-07-16 at 3.48.03 PM](https://hackmd.io/_uploads/SkMVd-Vu0.png) ``` { from: "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", to: "0xac03bb73b6a9e108530aff4df5077c2b3d481e5a", gasLimit: "21000", maxFeePerGas: "300", maxPriorityFeePerGas: "10", nonce: "0", value: "10000000000" } ``` ![Screenshot 2024-07-16 at 3.43.21 PM](https://hackmd.io/_uploads/ByFMvbE_C.png) ###### Explaination of the etherscan overview - **Transaction hash (also known as a transaction ID or TXID):** This is a unique identifier assigned to a transaction recorded on a blockchain. It is a critical component in tracking and verifying transactions across the network. - **Status:** It checks if it is success or undefined or failed - **Block:** It shows the block number and how many comfirmation it passes. - **Timestamp:** It show the Date of the transaction, - **From:** Who sent the token. - **To:** who is receiving the token. - **Value:** The amount of ETH sent or receive - **Transaction Fee:** The total amount of ETH paid by the sender to miners for processing the transaction **Calculation:** Transaction Fee = Gas Used × Gas Price. **Displayed As:** “Txn Fee” on Etherscan - **Gas Price:** The amount of ETH the sender is willing to pay per unit of gas. **Unit:** Usually measured in Gwei (1 Gwei = 0.000000001 ETH). ## Consensus Algorithm ###### Consensus When numerous nodes—usually most nodes on the network—all have the same blocks in their locally validated best blockchain. Not to be confused with consen‐ sus rules. ###### Consensus rules The block validation rules that full nodes follow to stay in consensus with other nodes. Not to be confused with consensus. 1. Proof of Work (PoW) - **Used By:** Bitcoin and early Ethereum (pre-Ethereum 2.0) - **Mechanism:** Miners compete to solve complex mathematical puzzles using computational power. The first miner to solve the puzzle gets the right to add a new block to the blockchain and is rewarded with cryptocurrency. This process is resource-intensive and requires significant computational power and energy. - **Pros:** * Highly secure and resistant to attacks. * Proven effectiveness in maintaining decentralized networks. - **Cons:** * High energy consumption. * Slow transaction processing times. 2. Proof of Stake (PoS) - **Used By:** Ethereum - **Mechanism:** Validators are chosen to create new blocks based on the number of coins they hold and are willing to "stake" as collateral. The likelihood of being selected to validate transactions increases with the amount of cryptocurrency staked. Validators receive transaction fees as rewards. - **Pros:** * More energy-efficient compared to PoW. * Faster transaction processing times. - **Cons:** * Can lead to centralization if a small number of participants hold most of the stake. * Potential security vulnerabilities if the staking process is not well-designed. 3. Delegated Proof of Stake (DPoS) - **Used By:** EOS, TRON - **Mechanism:** Stakeholders elect a small number of delegates to validate transactions and create new blocks on their behalf. Delegates are responsible for maintaining the blockchain and are rewarded with transaction fees. Delegates can be voted out and replaced by stakeholders. - **Pros:** * Highly scalable and fast. * Lower energy consumption. - **Cons:** * Centralization risk due to the small number of delegates. * Potential governance issues if voting power is concentrated. 4. Proof of Authority (PoA) - **Used By:** VeChain, POA Network - **Mechanism:** A limited number of validators are pre-approved and authorized to create new blocks. Validators' identities are known and trusted by the network. Used primarily in private or consortium blockchains. - **Pros:** * High transaction throughput and low latency. * Energy-efficient. - **Cons:** * Centralized control reduces decentralization benefits. * Trust in validators' integrity and behavior is required. 5. Practical Byzantine Fault Tolerance (PBFT) - **Used By:** Hyperledger Fabric, Zilliqa - **Mechanism:** Nodes in the network communicate with each other to agree on the state of the blockchain. A two-thirds majority is required to reach consensus. Designed to tolerate a certain number of faulty or malicious nodes. - **Pros:** * High fault tolerance and security. * Efficient and low latency. - **Cons:** * Scalability issues in large networks due to the high communication overhead. * More complex implementation. 6. Proof of Burn (PoB) - **Used By:** Slimcoin - **Mechanism:** Participants "burn" (destroy) a certain amount of cryptocurrency to gain the right to mine new blocks. Burning coins reduces the total supply, creating scarcity. Ensures commitment from miners by requiring them to incur a cost upfront. - **Pros:** * Reduces energy consumption compared to PoW. * Provides a fair way to distribute new coins. - **Cons:** * Still involves an element of waste (burned coins). * May not be as secure as PoW or PoS. 7. Proof of Elapsed Time (PoET) - **Used By:** Hyperledger Sawtooth - **Mechanism:** Participants wait for a randomly assigned amount of time. The first participant to finish waiting gets to create a new block. Uses secure hardware to ensure fairness and randomness. - **Pros:** * Energy-efficient and fair. * Scalable for large networks. - **Cons:** * Dependence on specialized hardware for security. * Potential centralization if hardware is controlled by a few entities. Feel free to ping me for questions: - :mailbox: badviruscoder@gmail.com - Mention `@Gosteanan` on [Twitter](https://twitter.com/g)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully