Murphy Zhang
    • 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 什么是 Relayer Relayer 是 BTTC 上资产跨链后的自动提款服务,用户将资产从 BTTC 上转移到其他链后,Relayer 会在接收链上帮助用户自动完成提款操作。 在没有使用 Relayer 服务的情况下,用户提交资产从 BTTC 链转移到其他链的请求,等待 15~30 分钟后资产达到目标链,需要用户在目标链调用`跨链桥合约`来提取资产。由于调用合约需要支付 Gas 费用,所以通常用户需要提前在目标链上创建了账户并确保账户中有足够的原生链代币来支付 Gas 费用。 使用 Relayer 服务后,当资产达到目标链后, Relayer 会帮助用户将跨链资产从`跨链桥合约`提取到`用户接收地址`,简化了用户的跨链操作。 ## Relayer 的原理 下图是 Relayer 工作机制: ![](https://i.imgur.com/9xbm506.png) 如上图所示,用户在 [bt.io](https://bt.io) 上提交 BTTC 到 Ethereum 的资产跨链请求时, 可以选择 Fast 模式或 Classic 模式,如果选择 Classic 模式,即不使用 Relayer 服务,[bt.io](https://bt.io) 会直接调用`跨链桥合约`执行跨链操作,当资产达到Ethereum链的`跨链桥合约`时,需要用户手动调用`跨链桥合约`将资产提到`用户接收地址`中。 如果用户选择了 Fast 模式,即使用 Relayer 服务,用户可以根据 Relayer 服务商的费用报价选择一个合适的服务商,用户跨链资产首先被转移给 Relayer 合约,Relayer 合约对资产进行切分,从跨链资产转移一部分给 Relayer 服务商作为费用报酬,然后将剩余部分提交给`跨链桥合约`进行跨链操作。 由于用户在 BTTC 链上提交跨链请求时指定了`用户接收地址`,该`用户接收地址`会被包含在跨链消息中一起到达 Ethereum 链,任何人都可以调用`跨链桥合约`触发提取资产行为,但是资产只会被提取到跨链消息中指定的`用户接收地址`。当 Relayer 合约提交跨链请求后,Relayer 服务商部署的服务程序会监听到跨链事件,当资产到达 Ethereum 链后,Relayer 服务程序会自动通过它的一个外部地址调用 Ethereum 链上的跨链合约将资产提取到接收者地址,并通过该外部地址支付 Gas 费用。 用户在选择快速模式时,可以选择将少量转出资产转换成相应的目标链汽油费,以满足用户在目标链接收跨链资产后需要支付汽油费转账的场景。Relayer 将承担因汇率波动造成的额外费用。 ## 申请成为Relayer [bt.io](https://bt.io) 已开启 Relayer 申请通道, 任何人都可以申请成为 Relayer,通过协助用户跨链并赚取手续费收益。Relayer 可以根据自己的运营成本和不同目标链的提款 Gas 消耗来设定费用。用户会根据费用、服务稳定性、用户评价等因素来选择 Relayer。 在申请成为 Relayer之前, 首先准备一台空闲服务器部署好Relayer 服务程序,请参考:[部署 Relayer 服务](/D35Ss52pR0Kyx-SvwSlUFA) 然后需要在 BTTC 主网准备最少 250 亿 BTT 的保证金,保证金在 Relayer 工作期间需要一直保持抵押状态,申请 Relayer并质押保证金的请参考:[申请 Relayer]()。 如果 Relayer 不再参与 BTTC 网络,则可以随时申请退出,退出成功后可取回保证金,请参考[ Relayer 退出并取回保证金]()。 ### Relayer奖励 用户使用Relayer服务时支付的手续费会全部作为奖励实时结算并由合约发给Relayer账户。 目前的 Relayer 服务收取实际提款 Gas 费120%,Relayer 会从用户跨链的资产中扣除部分作为费用,实际扣除数量的计算公式如下: ``` (跨链消耗的 Gas 费用 / 跨链代币的单价)* 120% ``` Relayer 从当前跨链的代币中扣除部分作为手续费,即跨什么币,收什么币, 计算费用时会将上述 Gas 费用和跨链代币转化成同一个记价单位进行计算。 ### 预留手续费 在 Relayer 申请被审批通过后,就可以开始接单。而在接单过程中,Relayer 需要调用智能合约以协助完成跨链用户的资产接收。由于调用智能合约需要消耗一定数量的 gas,因此建议 Relayer 在接单前准备足够的 gas 以应对这种消耗,建议预留的手续费: | 网络 | 建议预留的交易费 | | -------- | -------- | | TRON | 50,000 TRX 或同等资源(能量&带宽) | | Ethereum | 5 ETH | | BSC |1 BNB | 如果因 gas 费不足等原因导致订单未能完成,Relayer 将会被扣除一定数量的保证金,同时还会导致成单率降低。系统不会推荐成单率低于 60% 的 Relayer 给用户。 ### 惩罚机制 如果 Relayer 无法在规定的时间内完成订单,则需要被扣除一定的保证金作为惩罚,惩罚量计算方法是首先获取 Relayer 收费金额和协助用户完成跨链所消耗 gas 中的较大值,然后乘以惩罚系数 A,惩罚系数 A 目前为 1.3。 惩罚的形式是直接在 BTTC 网络上触发合约扣除保证金。当保证金余额低于 50 亿 BTT 时,Relayer 就会因保证金不足而无法继续接单。此时需要添加保证金至 50 亿 BTT 或以上,即可自动恢复接单。 ### 接单限制 Relayer 需要有足够的保证金完成接单,保证金的数量决定 Relayer 可接单数量, 可接单数量的计算公式如下: ``` 保证金数量 - 可接单最小保证金数量 / 惩罚系数 / 订单最大成本 ``` 其中,当前可接单最小保证金数量为 50 亿 BTT,惩罚系数为 1.3,订单最大成本为 3,600 万 BTT。

    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