experience
    • 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
    • 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 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
    # KEEP network (Random beacon/ECDSA groups) risk - liquidation and slashing details This document is based on the smart contracts for the following git snapshots: [tbtc@v1.1.0](https://github.com/keep-network/tbtc/tree/v1.1.0) [keep-ecdsa@v1.2.0](https://github.com/keep-network/keep-ecdsa/tree/v1.2.0) [keep-core@v1.3.0](https://github.com/keep-network/keep-core/tree/v1.3.0) See [TBTC tl;dr](#TBTC-tldr) and [Beacon tl;dr](#Beacon-tldr) if you do not care about the details. ## TBTC / ECDSA signing groups ### Abstract The two services offered by operators are depositing and redemption of BTC. Depositing BTC into custody produces a DepositToken (`TDT`), which can be exchanged for `TBTC`. Redemption then requires a `TDT` and burning of `TBTC`. In both cases operators can misbehave or fail and thus violating protocol needs to be discouraged. Here we try to outline these mechanisms for node operators, in order for them to better assess the risks of providing these services. ### TBTC tl;dr The risks of running a tBTC/ECDSA signer node are: | Event | Slashing (KEEP) | Lose collateral (ETH) | | -------- | -------- | -------- | | failing to create signing groups ([3 hours grace period](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCConstants.sol#L21)) | ❌ | ✅ (only [setup fee](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L95) paid by user) | ❌ | | collateral price peg breaking | ❌ | ✅ (goes to [auction winner](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L162) and [left-over split between group and reporter](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L183)) | | [group producing fraudulent signatures during funding](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L180) | ✅ ([all stake](https://github.com/keep-network/keep-ecdsa/blob/fb48534c25f93c41c14f9c5602390dd066705393/solidity/contracts/AbstractBondedECDSAKeep.sol#L377)) | ✅ ([goes to deposit owner](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L198)) | | [group producing fraudulent signatures](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L108) | ✅ ([all stake](https://github.com/keep-network/keep-ecdsa/blob/fb48534c25f93c41c14f9c5602390dd066705393/solidity/contracts/AbstractBondedECDSAKeep.sol#L377)) | ✅ (split between [submitter](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L180) and [auction winner](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L162)) | | failing to honor a redemption request (signature, [2 hour grace period](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCConstants.sol#L14); spv proof, [6 hour grace period](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCConstants.sol#L16)) | ❌ | ✅ ([redeemer gets tBTC](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L157) and bond is auctioned off, auction remains are [split between fraud reporter and signer group](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L181)) | | [group producing fraudulent signature during redemption](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L108) | ✅ ([all stake](https://github.com/keep-network/keep-ecdsa/blob/fb48534c25f93c41c14f9c5602390dd066705393/solidity/contracts/AbstractBondedECDSAKeep.sol#L377)) | ✅ (redeemer gets [full bond](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L84)) | This means that if you are part of an active signing group, your node should never be down for more than two hours, since your group could be requested to redeem a deposit at any point. If you are currently not part of a signing group, your node should never be down for more than three hours, since you could be elected to be part of a group at any point. ### Background The job of a node operator/staker is to hold BTC in custody. Custody is always shared between three operators for v1 of the TBTC system and these. BTC being held in custody here means that the custody group produces a joint secret key and a user wanting to put BTC into their custody would then send those to the address associated with this joint secret. This then implies that these deposited BTC can only be moved if all three operators cooperate and produce a signature. In v1 of TBTC both intentional and acciddental faults always affect all members of the signing group. This is because faults are not attributable. The [`Deposit`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/Deposit.sol#L21) is the most important logical unit for operators, since rewards and punishments stem from its state. An overview over the lifecycle of a `Deposit` can be found in the [TBTC docs](https://docs.keep.network/tbtc/#minting). ### Constants The different constants associated with the processes outlined can be found in the `TBTCConstants.sol` [here](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCConstants.sol#L3). The following ``` uint256 public constant REDEMPTION_SIGNATURE_TIMEOUT = 2 * 60 * 60; // seconds ``` would then mean that a group of signers has two hours, starting from the moment a redemption request is created, to produce a signature. ### Collateral Peg This section concerns the price peg of ETH collateral that TBTC signers have to bond to participate in the network and facilitate the minting of TBTC. Collateralization is always dependent on the exchange ratio of BTC and ETH. If 1 BTC can be exchanged for 50 ETH, 150% collateralization means that for a deposit of `1 BTC` the signers need to put up `75 ETH` collateral. This implies that relative price movements of either asset can risk the collateralization ratio to drop below safe margins. For example if BTC value were to double, then `1 BTC` would exchange for `100 ETH` and require `150 ETH` as collateral for an deposit. An old deposit with `75 ETH` as collateral would thus no longer meet the collateralization requirements. The initial values for collateralization can be found in [`TBTCSystem.sol`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCSystem.sol#L78) ``` initialCollateralizedPercent = 150 undercollateralizedThresholdPercent = 125 severelyUndercollateralizedThresholdPercent = 110 ``` The thresholds can be adjusted via [`beginCollateralizationThresholdsUpdate`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/system/TBTCSystem.sol#L262). So based on these numbers, a bond is safe as long as the collateral threshold is `>= 125%` (See [notifyCourtesyCall](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L193)). If `110% < collateral_ratio < 125%` anybody can notify the contract that a deposit is in danger via [notifyCourtesyCall](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L193). The deposit then enters the "courtesy call" state, during which the deposit can be [redeemed by anyone](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositUtils.sol#L481). That means, that `TBTC` can be directly exchanged for `BTC` without being the owner of the `TDT`. The deposit stays in this state for 6 hours (see [constants](#Constants)) or until `collateral_ratio >= 125%` and [`exitCourtesyCall`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L204) is called. If a given deposit has `collateral_ratio < 110%` (via [`notifyUndercollateralizedLiquidation`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L214)) or entered courtesy call more than 6 hours ago (via [`notifyCourtesyCallExpired`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L223)), it will start an [liquidation auction](#Liquidation-Auction). ### Deposit and Redemption During deposit and redemption a user interacts with a signing group. For any deposit, a signing group gets formed, which will take custody of the BTC being deposited. Each of these deposits is backed by a deposit token (`TDT`), which can later be redeemed for BTC again. [Deposits flow](https://docs.keep.network/tbtc/#minting) ### Slashing Slashing is the removal of bonds/collateral and stake without an auction. #### Stake Slashing of staked tokens only happens if signers produce a fraudulent signature, which was not requested by the system, i.e. the [`slash`](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/TokenStaking.sol#L482) function is only called via the [`slashForSignatureFraud`](https://github.com/keep-network/keep-ecdsa/blob/fb48534c25f93c41c14f9c5602390dd066705393/solidity/contracts/BondedECDSAKeep.sol#L90) function. There are two occassions for this: 1. [during funding](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L180) 2. [otherwise](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/Deposit.sol#L410) In both cases [100% of the stake for a given Keep are slashed](https://github.com/keep-network/keep-ecdsa/blob/fb48534c25f93c41c14f9c5602390dd066705393/solidity/contracts/BondedECDSAKeep.sol#L95). #### Deposit Collateral Deposit collateral gets slashed without an [auction](#Liquidation-Auction) in three cases: 1. failure to create a signing group: - only [setup fee](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L97) is forfeit and the group remembers should get back `deposit - setup_fee` 2. group produces fraudulent signatures during deposit funding - the owner the deposit gets the [full bond](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L198) 3. producing fraudulent signature during redemption request - redeemer gets [full bond](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L84) ### Liquidation Auction The auction always starts by seizing all deposit collateral (see [`startLiquidation`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L71)). Its execution then proceeds based on whether it was initiated by a fraudulent action, e.g. creating a signature that was not requested by the system (see [`provideFundingECDSAFraudProof`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L180)), a protocol timeout (e.g. [`notifySignerSetupFailed`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositFunding.sol#L85)) or undercollateralization (e.g. [`notifyUndercollateralizedLiquidation`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L214)) The bond is seized by the system and used to purchase TBTC to compensate the BTC deposit owner. 66.6667% (`10000 / initialCollateralizedPercent`) of the bond is offered in exchange for the outstanding BTC amount and is auctioned until 100% of the bond is offered. For example, if a deposit has a bond of `150 ETH` representing 150% of the BTC value, then the auction would start by offering to buy TBTC for `100 ETH` and increase the offer to the full `150 ETH` at the end of the auction, making the offer more profitable as time passes. The auction is open until a buyer is found. The amount available for auctioning is scaled linearly over the course of 24 hours (see [`auctionValue`](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositUtils.sol#L239)) If a portion of the bond remains after the auction, what happens to it depends on the cause of liquidation. **Under-collateralization or abort/timeouts:** "In case of liquidation due to undercollateralization or abort, the remaining bond value is split 50-50 between the account which triggered the liquidation and the signers." (See [here](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L1836)) **Fraud:** Any left-overs of the collateral after the auction is over, will be for the reporter of the fraud to take. (See [here](https://github.com/keep-network/tbtc/blob/f94110d676d939139572ef06e7eca300ce8f435f/solidity/contracts/deposit/DepositLiquidation.sol#L180)) The signers have control of the BTC wallet at the end of the liquidation process. Since signing a transaction with the private key requires 3-of-3 signatures, the signers have to coordinate to decide what they do with the funds (split equally, send funds to another address for some reason, etc). ## Random beacon The random beacon is a service to generate strong randomness in a distributed setting via a distributed signature generation. Nodes are put into signing groups of 64 members, which then jointly generate a signing key used whenever a new `entry` (name used for the randomness in the contracts) is requested. At the moment, this randomness is mostly used to randomly select operators for keeps. ### Beacon tl;dr The risks of running beacon node are: | Event | Seizing (KEEP) | | -------- | -------- | | more than 50% of beacon group members are offline for [6 * 64 blocks, ~90 minutes with 14s block time](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/KeepRandomBeaconOperator.sol#L107) | ✅ (see tables below for numbers) | | [fraudulent signature is generated](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/libraries/operator/Groups.sol#L377) | ✅ ([100% of min stake](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/libraries/operator/Groups.sol#L396)) | Minimum stake started at `100,000 KEEP` (at [`2020-04-28 02:52:46 UTC`](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/TokenStaking.sol#L85)) and decreases in `10,000 KEEP` steps down to `10,000 KEEP` over the course of two years. | Date | min stake | | ---- | ---- | | 2020-04-28 02:52:46 UTC | 100,000 | 2020-07-09 02:52:46 UTC | 90,000 | 2020-09-19 02:52:46 UTC | 80,000 | 2020-11-30 02:52:46 UTC | 70,000 | 2021-02-10 02:52:46 UTC | 60,000 | 2021-04-23 02:52:46 UTC | 50,000 | 2021-07-04 02:52:46 UTC | 40,000 | 2021-09-14 02:52:46 UTC | 30,000 | 2021-11-25 02:52:46 UTC | 20,000 | 2022-02-05 02:52:46 UTC | 10,000 For timeouts, i.e. whenever the majority of a group is offline for more than the [6 * 64 blocks](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/KeepRandomBeaconOperator.sol#L107), the below table can be used to find the applied punishment. [Punishment starts at just 1% of the min stake and goes up to 100% of the min stake after 6 months](https://github.com/keep-network/keep-core/blob/b2eb62592058518bcd15a3e3510487a5118c5a61/solidity/contracts/libraries/operator/Groups.sol#L414). Starting point here is the deployment of the `TokenStaking` contract, which was at at `2020-09-10 12:43:40 UTC`. | Start | End | Stake seized | | ---- | ---- | ---- | | `2020-09-10 12:43:40 UTC` | `2020-09-19 02:52:46 UTC` | 1% of 90,000 (= 900) | | `2020-09-19 02:52:47 UTC` | `2020-11-30 02:52:46 UTC` | 1% of 80,000 (= 800) | | `2020-11-30 02:52:47 UTC` | `2020-12-10 12:43:40 UTC` | 1% of 70,000 (= 700) | | `2020-12-10 12:43:40 UTC` | `2021-02-10 02:52:46 UTC` | 50% of 60,000 (= 30,000) | | `2021-02-10 02:52:47 UTC` | `2021-03-10 12:43:40 UTC` | 50% of 50,000 (= 25,000) | | `2021-03-10 12:43:41 UTC` | `2021-04-23 02:52:46 UTC` | 100% of 50,000 | | `2021-07-04 02:52:47 UTC` | `2021-09-14 02:52:46 UTC` | 100% of 40,000 | | `2021-09-14 02:52:47 UTC` | `2021-11-25 02:52:46 UTC` | 100% of 30,000 | | `2021-11-25 02:52:47 UTC` | `2022-02-05 02:52:46 UTC` | 100% of 20,000 | | `2022-02-05 02:52:46 UTC` | - | 100% of 10,000 | ### Seizing While for the ECDSA/TBTC system stake is fully burned, for the beacon there is a split of 95% of the seized KEEP being burned and the other 5% being rewarded to the reporter of the fault. For example, if someone where to report a timeout on 2020-10-01, members of the beacon group would lose `64 * (80000 * 0.001) = 5120 KEEP`, of which `5120 * 0.95 = 4864` would be burned and `5120 * 0.05 = 256` would be sent to the reporter of the timeout.

    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