https://github.com/bifrost-io/bifrost
One Stake, Endless Opportunities. Build with Polkadot SDK (Substrate).
https://github.com/bifrost-io/bifrost
appchain bifrost liquidstaking omnichain polkadot substrate
Last synced: about 2 months ago
JSON representation
One Stake, Endless Opportunities. Build with Polkadot SDK (Substrate).
- Host: GitHub
- URL: https://github.com/bifrost-io/bifrost
- Owner: bifrost-io
- License: gpl-3.0
- Created: 2019-07-29T10:11:20.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2026-03-25T06:15:14.000Z (2 months ago)
- Last Synced: 2026-03-25T08:10:49.450Z (2 months ago)
- Topics: appchain, bifrost, liquidstaking, omnichain, polkadot, substrate
- Language: Rust
- Homepage: https://bifrost.io
- Size: 91.3 MB
- Stars: 481
- Watchers: 14
- Forks: 94
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Homepage
Welcome,
Bifrost is a Web3 derivatives protocol that provides decentralized cross-chain liquidity for staked assets. By leveraging on the cross-consensus message ([XCM](https://wiki.polkadot.network/docs/learn-xcm)) it can provide cross-chain liquid staking services for multiple chains.
[Our mission](https://notion.bifrost.io/Bifrost-Roadmap-ba6c44bd4f684e5aa875ec44388b2330) is to provide standardized cross-chain interest-bearing derivatives for [Polkadot](https://polkadot.network) relay chains, parachains, and heterogeneous chains bridged with Polkadot.
š _Discover the Bifrost at [bifrost.io](https://bifrost.io/)._
š _Learn to use the Bifrost with our [docs](https://docs.bifrost.io/)._
š£ Supported by
[](https://github.com/bifrost-io/bifrost/actions/workflows/ci-build.yml)
[](https://www.codacy.com/gh/bifrost-io/bifrost?utm_source=github.com&utm_medium=referral&utm_content=bifrost-io/bifrost&utm_campaign=Badge_Grade)
[](https://github.com/paritytech/substrate)
[](https://github.com/bifrost-io/bifrost/blob/master/LICENSE)
[](https://app.bifrost.io)
[](https://stats.bifrost.io)
[](https://discord.gg/bifrost-io)
[](https://x.com/Bifrost)
## Get Build Help
To see a list of all available make commands and their descriptions:
```sh
make help
```
## Install Rust and required tools
```bash
curl https://sh.rustup.rs -sSf | sh
make init
```
## Build binary
```bash
make build-all-release
```
## Format code
```sh
make format
```
## Lint code
```sh
make clippy
```
## Testing
```bash
make test-all
```
## Generate runtime weights
if runtime logic change we may do the benchmarking to regenerate WeightInfo for dispatch calls
```bash
make generate-all-weights
```
## Testing runtime migration
If modify the storage, should test the data migration before production upgrade.
```bash
# bifrost kusama
make try-kusama-runtime-upgrade
# bifrost polkadot
make try-polkadot-runtime-upgrade
```
## Run local development parachain
run node with `--chain=bifrost-polkadot-local` to start a local development parachain (not Substrateās standalone --dev mode).
Bifrost does not support --dev.
Always use this chain spec instead of Substrateās --dev mode.
Before run local development parachain
You need to modify OnTimestampSet in the runtime to allow instant block production:
```rust
impl pallet_timestamp::Config for Runtime {
type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
/// A timestamp: milliseconds since the unix epoch.
type Moment = Moment;
-type OnTimestampSet = Aura;
+type OnTimestampSet = ();
type WeightInfo = pallet_timestamp::weights::SubstrateWeight;
}
```
## Run local testnet with polkadot-launch
### Install `polkadot-launch`
```bash
yarn global add polkadot-launch
cd -
```
### Build polkadot
```bash
# replace version with your target polkadot version
cargo install --git https://github.com/paritytech/polkadot --tag polkadot --locked
```
### Launch Polkadot and the parachain
```bash
cd -
polkadot-launch ./scripts/bifrost-launch.json
```
It will take about 1-2 minutes for the parachain to start producing blocks.
## Run local testnet with parachain-launch
### Install `parachain-launch`
```sh
yarn global add @open-web3/parachain-launch
```
### Generate docker files
```sh
parachain-launch generate --config=scripts/bifrost-docker-launch.yml --yes
```
It will pull images and generate required docker files in a folder called `output` in your current working directory
### Start relaychain and parachain
To start the nodes, navigate to the output folder that the generated docker scripts in and start containers:
```sh
cd ./output
docker-compose up -d --build
```
## Run full node
### Create `bifrost-fullnode` directory, generate `node-key` and get `bifrost.json`
```sh
mkdir -p ~/node-key
subkey generate-node-key --file ~/node-key/bifrost.key
```
### Start full node
Replace your-fullnode-name
```sh
docker pull bifrostnetwork/bifrost:latest
docker run -d \
-v ~/node-key:/node-key \
-p 9944:9944 \
-p 9933:9933 \
-p 30333:30333 \
bifrostnetwork/bifrost:latest \
--name your-fullnode-name \
--base-path "/data" \
--node-key-file "/node-key/bifrost.key" \
--chain "/spec/bifrost.json" \
--pruning=archive \
--rpc-external \
--ws-external \
--rpc-cors all \
--trie-cache-size 0 \
--execution wasm
```
### snapshot
There are also some snapshots you can use to quickly get started, these are provided by the community.
- Pre-req .
zstd and aria2
```sh
sudo apt install zstd
sudo apt install aria2
```
#### bifrost-kusama snapshots
- relay-chain data
```sh
# download dict
wget https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-kusama/relay.dict
# download zst data
aria2c -x10 https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-kusama/relay.tar.zst
# decompress: node is basepath, you can replace any dicrectory you like
mkdir node
tar -I 'zstd -vd -T0 -D relay.dict' -xvf relay.tar.zst -C node/.
```
- parachain data
```sh
wget https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-kusama/para.dict
aria2c -x10 https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-kusama/para.tar.zst
tar -I 'zstd -vd -T0 -D para.dict' -xvf para.tar.zst -C node/.
```
#### bifrost-polkadot snapshots
link:
- [relay chain dict](https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-polkadot/relay.dict)
- [relay chain zst data](https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-polkadot/relay.tar.zst)
- [para chain dict](https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-polkadot/para.dict)
- [para chain zst data](https://snapshot-1258776962.cos.ap-hongkong.myqcloud.com/bifrost-polkadot/para.tar.zst)