B
Unlocking the DeFi Gaming Paradigm for Bitcoin.
-
Bitcoin Wallet as a Smart Contract
- The first Turing-complete native smart contract solution of Bitcoin.
- An UTXO as an program unit
- A programmable Bitcoin wallet with PSBT, Miniscript & descriptor as a smart contract
- A programmable Bitcoin wallet as a Account Abstract
-
Bitcoin Native Finance Platform
- Bitcoin as M0 of crypto world
- Decentralized bank of Bitcoin
- Bitcoin native staking/loan
- Bitcoin native atomic swap
- Bitcoin fast pay with ckBTC
- Bitcoin derivatives
- Bitcoin credits
-
Bitcoin Multi-assets Issuance
- Ordinals assets Issuance
- Runes assets Issuance
- RGB assets Issuance
- RWA with Bitcoin Binding
- Stablecoin based Bitcoin
- osBTC 1:1 BTC (Principal Token)
- BOS for Yield Token
-
100% on chain with ICP
- BifiPal run on the best cryptography network.
- Chain-Key & Threshold Cryptography
- Modular blockchain network
- Smart contract container
- WebAssembly
- Best privacy
- Data sovereignty
To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.
To learn more before you start working with BifiPal, see the following documentation available online:
- Quick Start
- SDK Developer Tools
- Rust Canister Development Guide
- ic-cdk
- ic-cdk-macros
- Candid Introduction
- IC Bitcoin Integration
- Bitcoin Integration Wiki
- Basic Bitcoin example
- Bitcoin Canister Source Code
If you want to start working on your project right away, you might want to try the following commands:
git clone https://github.com/bitcoinOS/bicoinOS.git
cd bitcoinOS/
dfx help
dfx canister --help
If you want to test your project locally, you can use the following commands:
# Clone the `wasm-forge/wasi2ic` project:
git clone https://github.com/wasm-forge/wasi2ic
## Enter the wasi2ic directory and install it
cd wasi2ic
cargo install --path .
# Install just
cargo install just
# Starts the replica, running in the background
# Add --clean if you want to reset the dfx state: dfx start --background --clean
dfx start --background --enable-bitcoin --clean
# All the just command details are in `justfile`
# creat all canisters
just create_all_canisters
# Add wasm32-unknown-unknown target.
rustup target add wasm32-unknown-unknown
# Generate latest did files
# Ensure you env has installed clang.
just generate_did
# Deploy steward canister
just deploy_steward
# Deploy os canister
just deploy_os
# Deploy ic-siwb
just deploy_provider
just add_provider
# Deploy point canister
just deploy_point
just add_point
#Deploy stake canister
just deploy_stake
just add_stake
# Deploy frontend to canister
just deploy_frontend
# Creat a staking pool
just create_staking_pool
just deploy_ii
# Mint cycles on local network if you need
wallet=$(dfx identity get-wallet)
dfx ledger fabricate-cycles --t 2000 --canister $wallet
dfx wallet balance
# Deposit cycles to os canister if os canister cycles are not enought
dfx canister deposit-cycles 2000000000000 os
# Create staking pool canister by os canister
just create_staking_pool
# If you want to deploy smartwall for test by manually, In normal, the smartwallet will be install by os canister
# just deploy_wallet
# Install pnpm
curl -fsSL https://get.pnpm.io/install.sh | sh -
source ~/.bashrc
# install ic-siwb-provider frontend
cd packages/ic-use-siwb-identity
pnpm install
pnpm build
# frontend
dfx generate
npm i
npm run start
# deploy frontend
npm run build
# if necessary
npm config set registry https://registry.npmmirror.com
pnpm config set registry https://registry.npmmirror.com
sudo npm install -g typescript
pnpm install -D vite
pnpm install @types/react
pnpm install -D @vitejs/plugin-react
pnpm i -D vite-plugin-environment
pnpm i -D dotenv
pnpm i -D sass-embedded
Once the job completes, your application will be available at http://localhost:4943?canisterId={asset_canister_id}
.
If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:
- set
DFX_NETWORK
toic
if you are using Webpack - use your own preferred method to replace
process.env.DFX_NETWORK
in the autogenerated declarations- Setting
canisters -> {asset_canister_id} -> declarations -> env_override to a string
indfx.json
will replaceprocess.env.DFX_NETWORK
with the string in the autogenerated declarations
- Setting
- Write your own
createActor
constructor
Contributions welcome! Read the contribution guidelines first.
BifiPal is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.