LogoLogo
HomeDappGithub
  • 🌈What is Bifrost
    • Bifrost vs Others
    • Bifrost cross-chain architecture
    • Bifrost security model
  • 🧬Tokenomics 2.0
    • Overview
    • Protocol Growth Flywheel
    • Core - bbBNC
      • How to maximize your bbBNC yield?
      • How to get or redeem?
    • BNC
    • vBNC
    • Treasury
  • 📚FAQ
    • Glossary
    • What are vTokens?
      • vETH
      • vKSM
      • vDOT
      • vFIL
      • vGLMR & vMOVR
      • vMANTA
      • vASTR
      • Validator Governance
      • XCM V3 in Bifrost
      • Mint/Redeem vToken without Dapp
    • What is LoopStake?
      • LoopStake Lending Parameters
    • What is LST Governance?
    • What is LST Stable Swap?
    • What is vToken Delegation Voting?
  • 🏃Dapp Tutorials & use cases
    • Liquid Staking on Bifrost
    • Liquid Staking on Omni LS
    • Loop Stake (Leverage Staking)
    • Governance with vDOT & vKSM
    • Providing Liquidity on DEX/Perp DEX
    • Supplying Liquidity on Money Market
    • Yield DCA
    • Farming
    • Unstaking
  • 🦸For the Community
    • Ambassadors
    • Governance
      • Overview
      • Proposal Guidelines (polkadot.js)
      • Proposal Guidelines (Subsquare)
      • OpenGov Components
      • OpenGov Tracks
        • Root
        • WhitelistedCaller
        • Liquid Staking
      • Proposal Template
        • HRMP
        • Validator Boost List
      • Bifrost Fellowship
      • On-chain Identity
    • Rainbow Boost
  • ⚒️For Builders
    • Build with SLPx
      • Overview
      • Supported Networks
        • Soneium
        • Astar
        • Manta Pacific
        • Moonbeam
        • Moonriver
        • Ethereum
      • XCM Oracle
    • vToken APIs
    • Builder Programs
      • Grants and Funding Program
      • Open Bounties
      • Bug Bounty
  • 🧩For Partners
    • Reward-Share Program (RSP)
      • Why RSP?
      • Integrate RSP
      • Claim RSP Rewards
      • Terms & Conditions
      • FAQ
    • Join The Program
    • Validator Boost List (VBL)
  • ⚖️For Collators
    • Requirement
    • Run a Collator
    • Stop Collating
  • 📦Resources
    • Tools
    • Audit Report
    • Press Kit
    • Token Icon
Powered by GitBook
On this page
  • Table of Contents
  • Option 1 - Bifrost SLP API
  • Integrating Steps
  • Option 2 - Bifrost SLPx API (Cross-chain)
  • Integrating with EVM Contract
  • Integrating Steps
  • Integrating with Parachain
  • Integrating Steps
  • Option 3 - Bifrost Dapp Portal

Was this helpful?

  1. For Partners
  2. Reward-Share Program (RSP)

Integrate RSP

PreviousWhy RSP?NextClaim RSP Rewards

Last updated 10 months ago

Was this helpful?

Table of Contents

RSP members (with existing channel_id) can integrate RSP through the following three options:

  • Option 1 - Through Bifrost SLP API

  • Option 2 - Through Bifrost SLPx API (Cross-chain)

    • Integrating with EVM Contract

    • Integrating with Parachain

  • Option 3 - Through Bifrost Dapp Portal

Option 1 - Bifrost SLP API

Target Audience: Your front end can directly connect to the Bifrost (Polkadot / Kusama) parachain, such as Wallets and Dapps, etc.

Showcase 1: Staking Rewards - A PoS Data Platform

Showcase 2: Subwallet - Polkadot Wallet

Integrating Steps

  1. Get your UI & UX ready.

  2. Integrate Bifrost (Polkadot) vToken Mint API: vtokenminting_mint

    Call data: 0x7300080000e40b54020000000000000000000000000100000000

    • Check Bifrost Token indexes and decimals at here.

    • Input your channel_id (Apply you channel id via here)

Option 2 - Bifrost SLPx API (Cross-chain)

Target Audience: Blockchains that can call or deploy Bifrost SLPx across chains, such as Hydration, Moonbeam, Astar, Manta, Ethereum (coming soon), Base etc.

Integrating with EVM Contract

Showcase: Moonbeam, Astar, Manta (Omni.ls) - An omni-chain liquid staking dapp

Integrating Steps

  1. Get your UI & UX ready.

  2. Integrate SLPx API in your corresponding environment:

    • Your Dapp deployed on Moonbeam

    • Your Dapp deployed on Moonriver

    • Your Dapp deployed on Astar

    • Your Dapp deployed on Ethereum Mainnet (Coming soon…)

Integrating with Parachain

Showcase: Hydration’s Treasury Minted vDOT via SLPx

Hydration democracy called Bifrost SLPx via XCM and minted 1M DOT to vDOT: https://hydration.subscan.io/referenda/138?tab=preimage

Check the Preimage
[
  {
    "name": "calls",
    "type": "Vec<hydradx_runtime:RuntimeCall>",
    "value": [
      {
        "call_module": "Utility",
        "call_name": "dispatch_as",
        "call_index": "0d03",
        "params": [
          {
            "name": "as_origin",
            "type": "hydradx_runtime:OriginCaller",
            "value": {
              "system": {
                "Signed": "0x6d6f646c70792f74727372790000000000000000000000000000000000000000"
              }
            }
          },
          {
            "name": "call",
            "type": "Call",
            "value": {
              "call_index": "8900",
              "call_module": "XTokens",
              "call_name": "transfer",
              "params": [
                {
                  "name": "currency_id",
                  "type": "U32",
                  "value": 5
                },
                {
                  "name": "amount",
                  "type": "U128",
                  "value": "10000000000000000"
                },
                {
                  "name": "dest",
                  "type": "staging_xcm:VersionedMultiLocation",
                  "value": {
                    "V3": {
                      "interior": {
                        "X2": {
                          "col0": {
                            "Parachain": 2030
                          },
                          "col1": {
                            "AccountId32": {
                              "id": "0x5f13cfa22c9625df362d4f8f71647a50ed5d558a0c3d3dc72df679ecd7888d88",
                              "network": null
                            }
                          }
                        }
                      },
                      "parents": 1
                    }
                  }
                },
                {
                  "name": "dest_weight_limit",
                  "type": "staging_xcm:v3:WeightLimit",
                  "value": {
                    "Unlimited": "NULL"
                  }
                }
              ]
            }
          }
        ]
      },
      {
        "call_module": "Scheduler",
        "call_name": "schedule_after",
        "call_index": "0504",
        "params": [
          {
            "name": "after",
            "type": "U32",
            "value": 1
          },
          {
            "name": "maybe_periodic",
            "type": "option<Tuple:U32U32>",
            "value": null
          },
          {
            "name": "priority",
            "type": "U8",
            "value": 0
          },
          {
            "name": "call",
            "type": "Call",
            "value": {
              "call_index": "6b00",
              "call_module": "PolkadotXcm",
              "call_name": "send",
              "params": [
                {
                  "name": "dest",
                  "type": "staging_xcm:VersionedMultiLocation",
                  "value": {
                    "V3": {
                      "interior": {
                        "X1": {
                          "Parachain": 2030
                        }
                      },
                      "parents": 1
                    }
                  }
                },
                {
                  "name": "message",
                  "type": "staging_xcm:VersionedXcm@377",
                  "value": {
                    "V3": [
                      {
                        "DescendOrigin": {
                          "X1": {
                            "AccountId32": {
                              "id": "0x6d6f646c70792f74727372790000000000000000000000000000000000000000",
                              "network": null
                            }
                          }
                        }
                      },
                      {
                        "WithdrawAsset": [
                          {
                            "fun": {
                              "Fungible": "1000000000"
                            },
                            "id": {
                              "Concrete": {
                                "interior": {
                                  "Here": "NULL"
                                },
                                "parents": 1
                              }
                            }
                          }
                        ]
                      },
                      {
                        "BuyExecution": {
                          "fees": {
                            "fun": {
                              "Fungible": "1000000000"
                            },
                            "id": {
                              "Concrete": {
                                "interior": {
                                  "Here": "NULL"
                                },
                                "parents": 1
                              }
                            }
                          },
                          "weight_limit": {
                            "Unlimited": "NULL"
                          }
                        }
                      },
                      {
                        "Transact": {
                          "call": "0x7d0000000000000000000000000000000000000000000800026d6f646c70792f747273727900000000000000000000000000000000000000000467",
                          "origin_kind": "SovereignAccount",
                          "require_weight_at_most": {
                            "proof_size": 100000,
                            "ref_time": 10000000000
                          }
                        }
                      },
                      {
                        "DepositAsset": {
                          "assets": {
                            "Wild": {
                              "All": "NULL"
                            }
                          },
                          "beneficiary": {
                            "interior": {
                              "X1": {
                                "Parachain": 2034
                              }
                            },
                            "parents": 1
                          }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    ]
  }
]

Inside of this preimage, it contained the call data to call SLPx mint for vDOT.

Integrating Steps

  1. Construct a XCM batch call to call Bifrost-Polkadot API: slpx_mint

The cases below demonstrate the workflow of how to mint and redeem vToken on Hydration (parachain) via Bifrost SLPx, which leveraged by XCM.

Let’s assume Alice wants to mint DOT to vDOT on Hydration, a utility.batchAll call is needed:

Extrinsic Call Data, which includes several calls inside

  • Call 1:

Call xToken sending 1 DOT to Alice’s derived account on Bifrost.

  • Call 2:

Call xToken sending 0.02 BNC to Alice’s derived account on Bifrost.

Check Bifrost Token indexes and decimals at here.

  • Call 3:

Execute slpx_mint

FAQs:

  1. Why do I need to send 0.02 BNC when minting/redeeming DOT?

Because after the user on Hydration sends an XCM transact with the command to Bifrost, it needs the derived address of the Hydration user to perform the SLPx mint operation, and there is no asset in the derived address, which will cause the transaction fail.

  1. How that derived account is being calculated?

# Alice 
yarn calculate-multilocation-derivative-account \\
--ws-provider wss://eu.bifrost-polkadot-rpc.liebi.com/ws \\
--address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \\
--para-id 2034 \\
--parents 1

# console
Remote Origin calculated as SiblingChain
ParaID 2034
Parents 1
AccountId32: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
32 byte address is 0xf959d131179b0264f98ac96d2c9c13c403129f5de93e52f3a611ccd4294d1741
20 byte address is 0xf959d131179b0264f98ac96d2c9c13c403129f5d

Option 3 - Bifrost Dapp Portal

Target Audience: Any entities need a Bifrost Dapp Portol to direct users by attached with your channel_id.

  1. Make sure you already have a channel_id

  2. Generate your Bifrost Dapp Portal

Bifrost Dapp frontend has adapted to the RSP. Attach your channel ID at the end of app.bifrost.io, for instance, https://app.bifrost.io/?channel=[channel_id]. All stakes via this link will be counted as your valid minting.

For example, the channel_id of Staking Rewards is 1, the vToken minting of users who enter the Bifrost Dapp through the https://app.bifrost.io/?channel=1 will be counted as the effective minting amount of Staking Rewards.

🧩
https://www.notion.so/bifrost-io/Integrate-RSP-0ccbbac79c904457b38ba50efcf2da52?pvs=4#337c802b31cb4c0f93f013ecd210eff0www.notion.so