FolkLoreee
    • 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

      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.
      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

    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.
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Lesson 01 - Introduction to Zilliqa Protocol ## 1.1 Property of the Zilliqa Protocol by Han Wen (Ecosystem, Zilliqa) and Jaryl (Senior Web Dev, Shopify) ### Zilliqa Zilliqa is a Singapore-based blockchain entity and aims to focus its expansion within ASEAN. Why Zilliqa (why blockchain)? > High level of security without compromising computational power Zilliqa products (which form the core of this blockchain): - Zilliqa (smart contract _platform_) - Scilla (smart contract _language_) ### Open Finance Solution Stack :computer: ###### tags: `consensus` `sharding` `proof of work` `super majority` Open toolkit that supports dApp developers in Fintech. **Highly modular and transparent:** Since everything is open in blockchain environment, people can just plug anyone's solution to improve their own solution. **Decentralized Finance vs OpenFinance:** Decentralized just means that there is no regulations in creating the FinTech (==ideal== scenario where there is no fraud in the ecosystem). OpenFinance refers to a real-life implementation of Decentralizd Finance (with certain regulations, e.g. limit the level of anonymity). Readup: [The Block Crypto](https://www.theblockcrypto.com/) #### Zilliqa :heavy_dollar_sign: It takes 10 minutes/block for Bitcoin to reach consensus About 20 seconds/block for Ethereum to reach consensus And 1-2 minutes/block for Zilliqa to reach verification (Zilliqa doesn't do proof-of-work to reach consensus) How to make it faster? ==Sharding== ##### Network Sharding Group networks into smaller groups of nodes, allowing for greater capacity to process transactions and linear scalability: ~3000 TPS.[Truth capacity ?] Ultimately preventing congestion like what Ethereum and Bitcoin are facing now. ##### Proof of Work Unlike Bitcoin that uses Nakamoto consensus, Zilliqa uses proof of work as an "entry ticket" to allow nodes to join the network. It is to prevent people with high computing power from attacking the network (since there is now a way to do identification). **How it works :** 1. The fastest node within each shard is selected to be the "leader"(Directory Service C). However, every 1.5 hours, the DSC will keep rotating (round robin). At the end of epoch, there will be a pseudo random selection to select the next "leader". 2. The responsibility of the DSC is to give a mathematical puzzle to the other nodes inside the shard. 3. Afterwards, the nodes will be redistributed to other shards :arrow_right: allow fairer distribution to miners (how ?) Each shard needs 2/3 of nodes + 1 (super majority) to reach a consensus. ##### Practical Byzantine Fault Tolerance How to ensure that the message is not intercepted? When there is a transaction made: 1. Leader announces next record with "pre-prepare" message 2. Each node validates the record and multicasts a "prepare" message (check that the leader is correct) 3. Upon receipt of "prepare", a "commit" message is sent to the group 4. With supermajority of "commits", transaction is deemed confirmed (nodes that are unresponsive / falsely rejects or accepts are considered Byzantine (malicious)) #### Scilla Language How to ensure our contract has no bug? Scilla. => built in security (ensure that the contracts are not violated. how?) #### Infrastructure Partners Building a scalable ecosystem that allows partners to build upon each other's solutions. ### ZilHive The ecosystem built upon Zilliqa and Scilla. ZilHive supports developers with grants and accelerator programs to kickstart their development process. ## 1.2 Smart contracts with Scilla by Jaryl (Senior WebDev @ Shopify) ### Less Features By design, Scilla does not have a lot of features to prevent attacks. Possible attacks that Scilla prevents: 1. Contracts that leak funds 2. Unexpected change to blockchain state (usually language bugs) 3. Contracts that are killed Scilla also provides a "checker" that allows us to verify that the output is as expected (data validation) ### OCAML based Scilla is based on OCAML - a functional programming language. Documentation of OCAML is more encompassing. ### Interpreted Language Scilla is currently an interpreted language (easier to build), but is moving to compiled language, which is more efficient (faster execution, lower memory usage). Re-entrancy attack: when the smart contract calls another smart contract, in real time, it is open to attacks that cause the contract to go into an undetermined state. Scilla prevents that. ## 1.3 Working with Zilliqa wallets Zilliqa used to have the same encoding as Ethereum (`base16` checksum). Now, it uses the `bech32` checksum. Internally, in Zilliqa JS implementation, we can get both `base16` and `bech32` encodings. To view the blocks and transactions in Zilliqa wallets: [Viewblock.io](viewblock.io/zilliqa) ## 1.4 Using the ZilPay Wallet ### Assignment 1A Getting familiar with ZilPay (instructions in handout) ## 1.5 Hello World with Neo Savant IDE ### Assignment 1B Getting familiar with Neo Savant IDE (instructions in handout) ### Parallels between dApp APIs and REST APIs | REST API | dAPP API | | ---------------- | -------- | | Function|Transition| |API Route| Contract| ### Differences between dApp APIs and REST APIs Rest APIs are usually free to call (there is no "cost" incurred when calling the API), while dApp APIs require `gas` as the currency to rate-limit people from excessively using the APIs. ## 1.6 Zilliqa JavaScript library ### [Documentation](https://github.com/Zilliqa/Zilliqa-JavaScript-Library) ZilPay library is the modified version of the Zilliqa JS library. We can use this library injected by the extension to talk to the blockchain. Cannot trust the server to do it on our behalf because it defeats the purpose of blockchain. hence, client communicates directly with the blockchain. transition calls: basically like function calls in the blockchain blockchain governance: makerdao, compound BG: how to do voting with anonimity. Linking a self-sovereign identity to a "governmental identity" is a challenge. J: iCloud has a different approach in identity (keyring). It is only accessable on the local devices. ## Miscellaneous Notes

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    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