Staking SDK
Integrate native Bitcoin staking into your own frontend application, allowing your community easy access to all the benefits of LBTC.
Our TypeScript Staking SDK can be integrated into any frontend application: wallets, portfolio management apps, staking dashboards, custody portals.
If you're interested in integrating our Staking SDK please fill out this Google Form so we can issue you with a referral code.
Important: You must take all measures to reduce the risk of unauthorized users as per the same countries in our Terms of Service!
User Staking (Deposit BTC, Receive LBTC)
1) Retrieve a BTC deposit address
Firstly, check for an existing Bitcoin deposit address. Each Bitcoin Deposit Address is associated with a destination chain and address (for minting LBTC), and a referral ID.
If you have an address already, proceed to step 2. Otherwise, generate a new deposit address.
The user will first need to sign the destination address to prove ownership of their wallet address, as this will be the only place LBTC can be minted to for any deposits to the generated bitcoin deposit address.
Using this signature, generate a new deposit Bitcoin address (note this can take several minutes for the security consortium to validate). Populate the referralId
with the referral code we've provided you:
That's it! You now have an existing, or new, BTC deposit address, specify to the user. This address is a SegWit address for maximum compatibility, so your users can deposit from any wallet or centralized exchange.
2) Get Exchange Rate BTC: LBTC
It's important to show the user how much LBTC they will receive for any amount of BTC they wish to deposit. In the future we will allow automatic minting, where a small blockchain fee will be introduced to cover our costs.
3) Prompt the user to deposit Bitcoin
The user can now send BTC directly to the deposit address.
Note: The minimum amount is 0.0002 BTC (~$10 USD).
4) Check the user's Bitcoin deposits
5) User claims LBTC
After 6 Bitcoin confirmations, our security consortium will notarise the deposit and provide a signature. The user can then mint their LBTC with the signature provided.
User Unstaking:
1) Find all the user's Bitcoin deposits
Retrieve all the deposits made by the user with their specified address.
Note: record the signature that is returned for a given deposit, this will be used as the signature parameter in the unstake function below
2) Show the Network Security Fee to the user
There is a Network Security Fee for unstaking. Hence the user must only unstake amounts above this fee. This can be retrieved from the LBTC contract getBurnCommission
function.
This will be added directly to the SDK in the future.
3) Unstake the BTC
Unstaking is easy on Lombard! The user simply unstakes against the ERC20 contract, and waits for the 7 day withdrawal period, after which the BTC will be sent to the specified (not original) address.
Last updated