Babypie
  • ๐Ÿ“ƒTerms and Conditions
  • ๐Ÿ“บBabypie Introduction
    • ๐ŸŸ Bitcoin
    • โฌ›Babylon
      • โš™๏ธFinality Providers
      • ๐ŸŒSystems
      • ๐Ÿ•น๏ธStaking / Liquid Staking
  • ๐Ÿ’ปHow to stake BTC via Babypie
    • ๐Ÿ”ธStake WBTC via Ethereum
    • ๐Ÿ”ธStake WBTC via Arbitrum
    • ๐Ÿ”ธStake BTCB via BNB Chain
    • ๐Ÿ”ธStake BTC using OKX Wallet
    • ๐Ÿ”ธStake BTC using Bybit Wallet
    • ๐Ÿ”ธStake BTC using the Electrum BTC Wallet and an Ethereum Wallet
  • โš™๏ธBabypie's Architecture
  • ๐Ÿ’ŽBabypie's BTC Treasure Quest
    • ๐Ÿ‘ฅRefer and Earn More
    • ๐ŸงฎExample of Jewels Accumulation
  • โšชmBTC
  • ๐Ÿ’งsmBTC
  • ๐Ÿช™BBP Token
    • โš™๏ธBBP Tokenomics
  • ๐Ÿ“‘Smart Contracts
  • ๐Ÿ”Reference
    • ๐Ÿ’กGlossary
  • ๐Ÿ“กOfficial Links
  • ๐Ÿ“ฝ๏ธMedia Kit
  • ๐Ÿ”Security
    • ๐Ÿ“ƒSupremacy Audit
    • ๐Ÿ“ƒPeckshield Audit
    • ๐Ÿ“ƒAstrasec Audit
  • โ“FAQ
  • ๐ŸŒ‰CCIP Bridge
Powered by GitBook
On this page
Export as PDF

Babypie's Architecture

PreviousStake BTC using the Electrum BTC Wallet and an Ethereum WalletNextBabypie's BTC Treasure Quest

Last updated 9 months ago

1. Register Wallet: User sends the following values to the Babypie Manager:

  • Userโ€™s BTC address

  • Userโ€™s EVM address

  • Signature generated using the Bitcoin wallet by passing the EVM address as the message.

2. Babypie Manager Action: The Babypie Manager calls the Chainlink Functions Consumer contract, passing the three values it received from the user.

  • Babypie Manager: One of Babypieโ€™s smart contracts.

  • Functions Consumer: A smart contract that can send Functions requests to the Chainlink Oracle Network, where the oracle network returns the results of decentralized computation.

3. Chainlink Functions Consumer Contract Action: The Chainlink Functions Consumer contract sends a request to the Chainlink DON to run the script to verify the user's signature, using the EVM address as the message string.

4. Verification Result: The DON returns the result of the verification to the Chainlink Functions Consumer contract by calling it with the result (this process takes around 30 seconds).

5. Update User Mapping: The Chainlink Functions Consumer contract calls the Babypie Manager contract to update the user's BTC to EVM mapping if the signature is valid.

Now, the user can transfer native BTC to Babypieโ€™s MPC wallet (This step can even be done by user before mapping their BTC->EVM address)

6. BTC Transfer: The user calls the Babypie Manager with the transaction hash of the BTC transfer to Babypieโ€™s MPC wallet and the BTC address used for the transfer.

7. Requests to initiate mBTC mint for BTC transfer: User calls babypie manager to initiate verification of user's BTC transfer in txn and mint mBTC to user's mapped EVM address.

8. Babypie Manager Action: The Babypie Manager calls another Chainlink Functions Consumer contract with the transaction hash and the userโ€™s BTC chain address.

9. BTC Amount Retrieval: The Chainlink Functions Consumer contract sends a request to the Chainlink DON to run a script that will get the amount of BTC transferred to the Babypie MPC wallet in the transaction.

10. Amount Confirmation: The Chainlink Functions Consumer contract receives the result (amount of BTC transferred) of the script from the Chainlink DON.

11. Validation and Processing: The Chainlink Functions Consumer contract checks if the amount is greater than 0. If yes, it calls the Babypie Manager with the result.

12. Mark txn paid: The Babypie Manager will mark the txn as paid and call the mint function of the mBTC contract with value equal to BTC transferred by user.

13. mBTC mint: mBTC token will be minted to the user.

โš™๏ธ
DON - Decentralized Oracle Network