Inspiration
While reading about different tech stacks related to Bitcoin, I got to know about the Bitcoin developer kit very interesting as it focuses on giving library for Android (Kotlin) to build wallet applications. The second was Interlay, which helps users use Bitcoin in the deFi world by converting BTC to IBTC/KBTC which is a representation of BTC to be used any way you see fit in the Polkadot and Kusama ecosystems. Now, while reading the documentation I came across ( https://docs.interlay.io/#/guides/bridge ). Which says how important is the step of transferring BTC to the vault (to get back IBTC).
Current problem in sending BTC to Vault ( ref: https://docs.interlay.io/#/guides/bridge )
- If the user accidentally sent less BTC than required If you accidentally sent less BTC than was necessary, then automatic execution is disabled for security reasons. In this case, you will have to execute your request manually within 24 hours. Otherwise, your BTC will be lost.
- User accidentally sent more BTC than required One of two things will happen. If the vault had sufficient capacity to accomodate your larger request, it will be executed automatically, and no further action on your part is required. If the vault does not have sufficient capacity, then a Refund request will be automatically created, giving the vault the option to return the excess BTC to you. However, since IBTC is a decentralized system, there is no way to ensure that the vault fulfills this.
Solution
An app that has a Bitcoin wallet integrated with interlay, which could apply all the checks required to send the exact amount of BTC to the vault for conversion to IBTC. Or the User can first transfer the BTC to the app's BTC wallet and then use the App's wallet to transfer it to the vault.
A small note
Currently, due to some technical difficulty (https://discord.com/channels/745259537707040778/1146051297611624548/1157280363895332954). I am not able to utilize the interlay API, so I have used some dummy data to show the expected working of my proposed solution.
What it does
This is an Android app that uses a Bitcoin developer kit to build a Bitcoin wallet and also has feature to support Interlay swap to IBTC. It tries to use the Interlay typescript API to interact with the interlay blockchain. And when the swap request is generated the app will handle all the calculations to get the right amount of BTC to be sent to the vault from the app's internal wallet
How we built it
I used Android Studio (kotlin) and BDK to develop the android app. NodeJS is used to build a backend that uses Interlay-api to interact with Interlay
Challenges we ran into
The interlay-API is very challenging to work with, I have discussed (https://discord.com/channels/745259537707040778/1146051297611624548/1157182022691864617) my issue with the compilation errors I am facing, so currently I have done some code with this (https://github.com/shubhamji88/Interlay-x-BDK-android/tree/master/interlay). But mostly there are dummy data to present my solution
Accomplishments that we're proud of
Successfully integrate BDK functionality in the app and showcasing an approach to solve a big issue the BTC to IBTC conversion
What we learned
I learned a lot about Bitcoin, different solutions.
What's next for Safe Interchain
I wish to complete this project by fully integrating the interlay-API, for which I would require some support from the dev team. and help me solve this issue.
Built With
- android
- bdk
- interlay
- kotlin
- typescript
Log in or sign up for Devpost to join the conversation.