-
-
Page where user can borrow synthUSD (stable coin pegged to usd) for CKBTC
-
Form where user can add ckbtc as collateral toa vault
-
Main Page(Wallet connection)
-
Synth Page
-
Create a new Vault or get details about existing vault
-
Page to deposit BTC directly .
-
Profile Page where user can withdraw , deposit in ckbtc and BTC
Inspiration
Our inspiration behind this project was the development of a decentralized protocol aimed at facilitating the instantaneous unlocking of liquidity for ckbtc. The challenge we recognized was that obtaining liquidity for your bitcoin is not a straightforward task. Frequently, individuals are compelled to either sell their bitcoin on an exchange or bridge it to a different blockchain. However, such actions entail forfeiting the security safeguards provided by the bitcoin network. Additionally, bridged versions of bitcoin are often the wrapped versions, and their security depends upon the security of the bridge itself.
With our platform, we sought to offer a solution that enables anyone to deposit their CKBTC as collateral. In return, they can mint a stable coin against this collateral, thereby users can unlock instantaneous liquidity for their BTC holdings.
What it does
Our innovative protocol allows users to mint stablecoins against their ckbtc holdings. Users can deposit either ckbtc or BTC directly (which is converted into ckbtc under the hood). Currently, the platform supports the creation of a USD stablecoin called SynthUSD. Our modular solution enables the easy creation of new types of stablecoins as needed.
All our stablecoins adhere to the ICRC-2 standard, ensuring compatibility with the broader ecosystem. Any protocol requiring stablecoins for its operation can seamlessly integrate our stablecoin.
The protocol requires users to create a new VAULT and deposit collateral (in the form of ckbtc or btc). The maximum borrow amount is set at 80% of the deposited collateral. Users can mint (borrow) against the deposited collateral and can withdraw their collateral at any time by repaying their initial debt along with any accrued interest during the borrowing period.
Additionally, we have implemented a liquidation mechanism to handle vaults that fall below the maximum Loan-to-Value ratio. The protocol relies on market participants to maintain the stablecoin's peg. If the stablecoin's price falls below $1, market participants can buy new tokens from the market to redeem the collateral in the vaults. Conversely, if the stablecoin's price exceeds $1, they can mint new tokens and sell them on the open market.
How we built it
We used the Azle framework (TypeScript) to construct the backend canisters responsible for managing all the logic of our protocol. To obtain real-time price data for the collateral, ckbtc, we integrated an exchange rate canister as an oracle. Our system is divided into four main components:
Oracle Canisters: These components facilitate the retrieval of the latest ckbtc price against the required fiat currency. By separating this functionality into a distinct canister, we ensure proper validation and a standardized approach for other canisters to access price data.
Deposit Module: This canister simplifies the process for users to deposit ckbtc or BTC. It is responsible for ensuring the secure handling of collateral amounts and implementing robust security measures to prevent potential attacks.
SynBase: This canister serves as an ICRC-2 compatible fungible token and is the foundation for various stablecoins (currently implemented type synUSD). It enables the creation and management of new types of stablecoins.
SynthMinter: Responsible for minting new stablecoins and burning existing ones, this canister plays a pivotal role in maintaining security and offering a unified interface for minting and burning operations.
VaultManager: This core canister manages various user flows, primarily including:
- Creating new vaults.
- Adding collateral to existing vaults
- Borrowing (minting) stable coins against the deposited colletaral
- Repaying your debt(buring the stable coin)
We built our frontend using NextJs and integrated the bitfinity wallet as the default choice of wallet acrosss our platform as we believe that is the widelt adopted wallet in the ecosystem. Due to awesomeness of ICP it was breeze integrating our canisters with our frontend and everything worked like a charm . We styled up our webpage to match the awesomeness of ICP :) Canister Ids:
- oracleCanister: "nhkh6-wiaaa-aaaal-qcdpq-cai"
- DepositModuleCanister: "ivtqt-gqaaa-aaaal-qcdra-cai"
- SynthTokenCanister: "i3r53-5aaaa-aaaal-qcdqa-cai"
- SynthMinterCanister: "i4q3p-qyaaa-aaaal-qcdqq-cai"
- vaultManager: "isswh-liaaa-aaaal-qcdrq-cai" ## Challenges we ran into
In our endeavor to build the protocol using the Azle framework (TypeScript), we faced several challenges:
Implementing ICRC Standards: We couldn't find an existing TypeScript implementation of ICRC-1 or ICRC-2, so we undertook the task of building the entire implementation from scratch. This effort was time-consuming as we ensured it adhered precisely to the specifications and followed best security practices.
Oracle Compatibility: Initially, our oracle was set up to fetch data directly from sources like Binance using HTTP Outcalls. However, after deploying on the mainnet, we realized there were compatibility issues with IPV4 and IPV6. Consequently, we had to rewrite the oracle to fetch price data from the exchange rate canister.
Complex System Design: Given the complexity of the system, a substantial amount of time was dedicated to refining our canisters and making various design decisions to align with best practices. Simultaneously, we aimed to provide a seamless user experience.
Limited Resources: The Azle framework being relatively new, we encountered challenges for which resources were scarce. Nonetheless, with the invaluable support and awesomeness of the ICP community, we successfully navigated these hurdles.
On the frontend, initially, we encountered some challenges in designing the webpage and adapting it to the asynchronous nature of the ICP blockchain. Along the way, we gained valuable insights into designing an effective user interface and how to build robust contracts.
Accomplishments that we're proud of
We take great pride in our project and the collaborative effort that went into its development. Our achievements include:
ICRC-2 Implementation: We successfully implemented the ICRC-2 standard entirely from scratch in TypeScript, ensuring its adherence to specifications and best practices.
Streamlined Collateral and Minting Process: We simplified the process of adding collateral and minting stablecoins, making it user-friendly and efficient.
Flexibility for Users: Our platform allows users to directly deposit both CkBTC and BTC according to their preferences, enhancing user convenience.
Aesthetic UI Design: We designed an appealing user interface and prioritized delivering a seamless user experience, ensuring our platform is not only functional but also visually engaging.
What we learned
Throughout the development of this project, we gained valuable insights and knowledge:
ICP Blockchain Advantages: We discovered the remarkable capabilities of the ICP blockchain, such as the ability to fetch BTC prices directly using outcalls, eliminating the need for intermediaries.
Chain-Key Cryptography Bitcoin (ckBTC): We learned how to ckBTC integrated BTC directly using chain-key cryptography (ckBTC), offering a cost-effective and secure alternative to interacting with the Bitcoin mainnet directly.
Secure Smart Contract Development: Working on this project honed our skills in writing secure smart contracts, ensuring the robustness and reliability of our protocol.
User Interface Design: We developed expertise in crafting seamless and visually appealing user interfaces, enhancing the overall user experience.
ICP Network Standards and Specifications: We deepened our understanding of the various standards and specifications within the ICP network. This newfound knowledge will undoubtedly prove invaluable in our future projects.
What's next for SynthiFy
In the immediate future, we have several key priorities for SynthiFy:
Security Enhancements: Our primary focus is to conduct multiple rounds of internal security reviews to ensure the robustness of our backend canisters. We are committed to implementing various methods to enhance security and provide a seamless user experience.
External Audits: We plan to open our contracts for external audits by the community. If grants become available, we intend to hire an external security audit company to conduct a thorough review of our contracts to further bolster security.
Frontend Improvements: We recognize the importance of a user-friendly frontend. As such, we will be concentrating on enhancing the frontend to offer an even more seamless experience to our users.
Decentralized Liquidation: Currently, our liquidation mechanism is internal and centralized. However, our goal is to allow anyone to participate in the liquidation process, provided it meets certain criteria, such as exceeding the maximum Loan-to-Value (LTV) ratio. We plan to incentivize individuals who participate in the liquidation process.
Staking Protocol: We are exploring the implementation of a staking protocol, allowing users to stake their stablecoins and earn interest. This initiative aims to accelerate the adoption of our stablecoin and provide additional utility to our users.
These steps reflect our commitment to ongoing development and improvement, ensuring the continued success and utility of SynthiFy.
Built With
- azle
- css
- icp
- nextjs
- typescript


Log in or sign up for Devpost to join the conversation.