Anton Cheng
    • 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
    # Complete Version: Reason why we can't support multiple XLM addresses There are two facts that cause this issue: (1) The famous **key derivation protocol - [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)**, and **HD Wallet Derivation Protocol** [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and (2) The current workflow of our App ## The BIPs ### BIP32 BIP32 defined two kinds of key derivation function (generate a child key from a parent key): **hardened derivation** and **non-hardened derivation**. If you want to derive a child public key(which is the address), with **Hardened derivation**, you must use a parent private key to derive a child private key, and then convert the child private key to child public key. With **non-harden derivation**, you can just use a parent **public key** to derive a child public key. **Note here: in BIP32, it only defined how non-harden derivation works for ECDSA**(Elliptic Curve Digital Signature Algorithm). ### BIP44 BIP44 defines a hierarchical key derivation schema about how to use BIP32 , (This is also the reason why we can use a single mnemonic sentence to recover our addresses on different wallet APPs.): ``` MASTER / purpose' / coin_type' / account' / change / address_index ``` This is called the `path` of a key, the ` ' ` above means harden-derivation. A note here is that the harden-derivation is only use until **Account Layer**. ### Example An Example about how to follow this protocol to derive a bunch of bitcoin addresses: Since we are following BIP44, we should use `purpose=44` in the derivation. and BTC has a coinType of `00` (you can check the coinType list [here](https://github.com/satoshilabs/slips/blob/master/slip-0044.md)), and we also have to define we're using **Account 0**, change 0, and address 0. Now it's time to derive the keys: 1. Master Private Key -- (harden) -> **Purpose Private Keys No.44** 2. **Purpose Private Keys No.44** -- (harden) -> **CoinType Private Key No.0** 3. **CoinType Private Key No.0** -- (harden) -> **Account Private Key No.0** And then what people usually do is 4. **Account Private Key No.0** --> Convert to -> **Account Public Key No.0** This is because start from this layer, BIP44 defines that we start using **non-harden derivation**, which is more convenient. Now we can just use Public keys to derive public keys, in CoolWalletS, this is when SE return the **Account Public Key No.0** to the App, so the App can freely derive any amount of **public keys** it wants with only the access of a public key. So the last two steps would be: 5. **Account Public Key No.0** -> (non-harden derive) -> **Change Public Key No.0** 6. **Change Public Key No.0** -> (non-harden derive) -> **Address Public Key No.0**. ### What's different with Stellar Stellar is that it's using EdDSA instead of ECDSA (just a different key pair generation algorithm), just like Cardano(ADA). And there's no standard about how **non-harden key derivation work with EdDSA**. Most Stellar wallets out there simply generate a private key - public key pair for a user each time the user wants to add an address. That means, most Stellar wallet is not using BIP32 to have multiple addresses with one master key. But XLM also registered an BIP44 coinType in the registered list we mentioned before, this means if any BIP44-compatible wallet wants to add XLM, they can use this coinType and maybe implement their own non-harden derivation, or just use the **Account Layer** as address layer keypair, like Ledger. We decided to follow Ledger, using Account Layer public keys to be presented as address, and use the private keys to sign the transactions. **In terms of SE, we can still support multiple addresses and optimize the derivation process in signing like other coins**, we just have to store the the private key of coinType layer, (the parent layer of account layer). ## What make us unable to support multiple address NOW The main reason is that in the current workflow, we have two features that conflict with this key schema: Add New Address and Asset Search during recovery. ### New Address Originally Adding a new address will not need the user to connect to your CoolWalletS, but this is impossible for Stellar. Like we mentions in the key derivation [Example](#Example), our app will have a replica of **Account Layer PublicKey** for every ECDSA coins, so adding an address is easily a derivation on the App side. But since EDDSA doesn't have non-harden key derivation, we cannot store a **parent public key** at App side and just use it to derive a child public key. **Every time we need a new child public key, we need it from the parent private key.** Of course, all the private keys should be store in CoolWalletS, So we need to connect our App with CoolWalletS anytime we need a new address. ### Asset Search The reason is similar to the one above. Right now, in the setup phase, our app automatically search for all used address for every currency. This is already very time consuming. If we have to support Asset Search for Stellar, It will take ~10 sec more for every address search since we will have to connect and derive again for every address. This is not feasible unless we change the rule of asset search in the future. To avoid confusion for our user in these two features, we wont not supporting multiple addresses in the wallet right now. We CAN support it if that's really the market wants, but some old rules or features may need to be updated as well.

    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