A Bitcoin Native Smart Contract & Finance Layer

Overview

Apache-2 licensed PRs Welcome

What's bitcoinOS

bitcoinOS A Bitcoin Native Smart Contract & Finance Layer.

  • 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

    • bitcoinOS run on the best cryptography network.
    • Chain-Key & Threshold Cryptography
    • Modular blockchain network
    • Smart contract container
    • WebAssembly
    • Best privacy
    • Data sovereignty

White paper

Vision

  • Bitcoin Assets Hub: bitcoinOS serves as a comprehensive platform for managing Bitcoin native assets, including but not limited to BTC transfers, as well as issuing and trading Ordinals, Atomicals, and RGB assets. As the Bitcoin L2 layer within bitcoinOS, Fastnet facilitates the issuance and trading of RGB assets, providing financial support and fast payments for dApp and ecosystems. bitcoinOS is an excellent hub and funding pool for various Bitcoin assets, catering to a wide range of asset needs.

  • One-stop Platform: While Bitcoin L1 has successfully established sovereignty over identity and assets, bitcoinOS takes this concept to new heights. Built upon Bitcoin L1 as its core, bitcoinOS utilizes the RGB smart contract protocol on the ICP network to construct Bitcoin L2: Fastnet. Fastnet offers comprehensive Bitcoin smart contract functionality and unlimited scalability, while also strengthening support for data sovereignty, elevating data assets to first-class status. Thanks to the excellent privacy features of RGB and ICP, bitcoinOS not only enables the development of better Web3 applications but also facilitates the development of superior Web2 applications, making it a unified platform for various applications.

  • Gateway to AGI: Data assets are considered among the most important digital assets. Just as Bitcoin is digital gold, data is digital oil, and bitcoinOS serves as the catalyst for the digital oil revolution. As the first Bitcoin network to grant data ownership, bitcoinOS is positioned as the gateway to the era of artificial intelligence. In the age of artificial intelligence, data becomes the most crucial factor of production, and possessing bitcoinOS and data assets becomes the ticket for every individual to enter the era of artificial intelligence. You may not have your own large-scale model, but you must have your own unique intelligent entity.

  • Foundation for Bitcoin Mass Adoption: As the cornerstone driving the widespread adoption of Bitcoin, bitcoinOS combines the transparency of Bitcoin assets with the versatility of the Fastnet universal network. Fastnet not only facilitates fast payments but also ensures the privacy of content and services, while almost unlimited scalability meets diverse application needs. bitcoinOS positions Bitcoin assets as the universal token of the digital world in the era of artificial intelligence.

  • Copilot of Developers & Creators: The runtime environment of bitcoinOS is based on WebAssembly, standing at the forefront of the IT industry's standards and benefiting from the research achievements of the entire industry. The core functionality of bitcoinOS smart contract containers simplifies the complexity of developing smart contracts for developers. They can utilize various programming languages that support WebAssembly, such as Golang, JavaScript, Python, and Rust, for development. Additionally, the built-in dApp Store, Data Store, and GPT Store in bitcoinOS greatly facilitate developers and users in accessing various resources of the Bitcoin ecosystem and innovating using data and AI models.

Architecture

avatar

Setup

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 bitcoinOS, see the following documentation available online:

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/bitcoinOS.git
cd bitcoinOS/
dfx help
dfx canister --help

Running the project locally

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


# All the just command details are in `justfile`
# Create all canisters
just create_all_canisters

# Compile smartwallet to wasm
just build_wallet

# Compile stakingpool to wasm
just build_staking

# Deploy steward canister
just deploy_steward

# Deploy os canister
just deploy_os

# 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
dfx canister call os create_staking_pool_canister '(record { duration_in_day = 1:nat64; name = "staking pool test"; description = "a staking pool with 10 annual interest rate for a year"; annual_interest_rate = 10:nat16 })'

# If you want to deploy smartwall for test by manually, In normal, the smartwallet will be install by os canister
# just deploy_wallet

just deploy_ii

just deploy_point
  
# Deploy frontend to canister
just deploy_frontend

# frontend
dfx generate
npm i
npm run start
# deploy frontend
npm run build

Once the job completes, your application will be available at http://localhost:4943?canisterId={asset_canister_id}.

Note on frontend environment variables

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:

  • setDFX_NETWORK to ic 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 in dfx.json will replace process.env.DFX_NETWORK with the string in the autogenerated declarations
  • Write your own createActor constructor

Contribute

Contributions welcome! Read the contribution guidelines first.

License

bitcoinOS 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.

You might also like...
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

Smart Contract for Terra Name Service

TERRA NAME SERVICE CONTRACTS Terra Name Service is to create easy-to-remember names for your Terra address like ‘dokwon.ust’ instead of ‘terra1...whez

Emerging smart contract language for the Ethereum blockchain.

Emerging smart contract language for the Ethereum blockchain.

Vectis - Smart Contract Wallet

A smart contract wallet project to add functionality for users of DApps to manage their keys by allowing for recovery and account freeze, whilst preserving user control, and enabling relayer capability for gas provisioning

Smart Contract built in Rust to run inside Cosmos SDK module on all chains that enable it

CoinSwap is a Smart Contract that is built on the terra blockchain and can be used to swap cryptocurrencies such as LUNA, UST, TerraUSD, Anchor, Mirror Protocol, LUNI and other CW20 tokens. The Project also contains a smart contract which works as a analysis tool for the gas fees on the Terra Blockchain.

Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.
Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.

Heimdall is an advanced EVM toolkit which aims to make dealing with smart contracts on EVM based chains easier. Installation & Usage Heimdall's update

A simple example demonstrating cross-contract calls in CosmWasm smart contracts

Cross-contract calls This tutorial demonstrates cross-contract calls with CosmWasm v1. Overview An end user calls the reservation contract to register

The Ink! smart contract SDK for XVM interface

Ink! XVM SDK The Ink! smart contract SDK for XVM interface. This SDK contains contract wrappers and all middleware code to make XVM development easy.

Example NFT marketplace project using ink! smart contract.

NFT Marketplace project This contract is an example for the NFT marketplace implementation. License Apache 2.0 🏗️ How to use - Contracts 💫 Build Use

Comments
  • question about the BitcoinOS

    question about the BitcoinOS

    1. Build upon the Bitcoin. How? Does ICP was built upon the bitcoin?
    2. Where do you import the rgb-std, rgb-core, and other rgb libs? (I just saw it in the Cargo.toml)
    3. How do you save the rgb schema in ICP network? (Now there is only the RGB20 asset)
    4. How do you validate your business logic for your rgb schema? (You need ALU script to validate the genesis, transistion logic, how do you validate it on the ICP network?)
    5. What's the relationship between the LLM and the BitcoinOS? (One for the AI, and the other for the decentralized finance network)
    6. Where do you validate your rgb historical data state? (For the single use seals and the consignment)
    opened by cymqqqq 1
Skyward Finance smart-contracts

Build and Init ./build.sh near dev-deploy res/skyward.was export CONTRACT_ID=skyward.testnet near call $CONTRACT_ID new --account_id=$CONTRACT_ID Regi

Skyward Finance 777 Jan 4, 2023
Bitcoin Push Notification Service (BPNS) allows you to receive notifications of Bitcoin transactions of your non-custodial wallets on a provider of your choice, all while respecting your privacy

Bitcoin Push Notification Service (BPNS) Description Bitcoin Push Notification Service (BPNS) allows you to receive notifications of Bitcoin transacti

BPNS 1 May 2, 2022
Minimal Bitcoin wallet intended for teaching rust-bitcoin

Insanely minimal Bitcoin wallet intended for demonstration of Rust Bitcoin ecosystem Absolutely DO NOT use with mainnet funds!!! No privacy - address

Martin Habovštiak 4 May 5, 2023
Modern, lightweight & standard-compliant bitcoin wallet runtime & cli without rust-bitcoin dependencies

Bitcoin protocol command-line wallet & tools Modern, minimalistic & standard-compliant cold wallet from LNP/BP Standards Association. Contributing Con

BP: Bitcoin protocol 3 Jul 31, 2023
Substrate NFT !ink smart contract base

Substrate !ink NFT simple implementation This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0

POLK4.NET 14 Dec 3, 2022
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

Zeke Medley 7 Oct 3, 2022
Testing a smart contract on the Solana blockchain

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

Maurice 1 Oct 25, 2021
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

zeke 7 Oct 3, 2022
The NFT smart contract powering xyz on Terra

xyz NFT Contract This repository contains the core NFT smart contract that implements xyz, a base layer for metaverses on the Terra blockchain. The xy

null 16 Sep 25, 2022
An example smart contract that builds on top of xyz

xyz Guestbook Tutorial Contract This repository contains an example smart contract that illustrates how to build on top of the xyz NFT contract. This

null 5 Apr 4, 2022