Hello, Bitcoin
BUILD on Bitcoin at the speed of ICP. Bitcoin on ICP is not just a future promise, developers are already building incredible use cases.
Bitcoin integrationThis code snippet is written in both Rust and the Motoko programming language but is also possible for Solidity, TypeScript, Python, and other languages.
import evm "ic:a6d44-nyaaa-aaaap-abp7q-cai";
import ic "ic:aaaaa-aa";
import Cycles "mo:base/ExperimentalCycles";
import Timer "mo:base/Timer";
actor {
let EVM_FEE = 1000;
let BITCOIN_FEE = 1000;
func check_evm_log() : async () {
Cycles.add<system>(EVM_FEE);
let log = await evm.eth_getLogs(
#EthMainnet(null),
null,
{
addresses = ["address"];
fromBlock = ? #Finalized;
toBlock = ? #Finalized;
topics = ?[["topic1", "topic2"]];
},
);
switch log {
case (#Consistent(#Ok(_))) {
await send_bitcoin();
};
case _ {};
};
};
func send_bitcoin() : async () {
Cycles.add<system>(BITCOIN_FEE);
await ic.bitcoin_send_transaction({
transaction = "\be\ef";
network = #testnet;
});
};
let _ = Timer.setTimer<system>(#seconds 2, check_evm_log);
};
#![allow(non_snake_case, clippy::large_enum_variant, clippy::enum_variant_names)]
use std::time::Duration;
use candid::{self, CandidType, Deserialize, Principal};
pub const SCRAPING_LOGS_INTERVAL: Duration = Duration::from_secs(3 * 60);
fn setup_timers() {
ic_cdk_timers::set_timer(Duration::ZERO, || ic_cdk::spawn(check_evm_log()));
ic_cdk_timers::set_timer_interval(SCRAPING_LOGS_INTERVAL, || ic_cdk::spawn(check_evm_log()));
}
#[ic_cdk::init]
fn init() {
setup_timers();
}
async fn check_evm_log() {
let cycles = 10_000_000_000;
let canister_id = Principal::from_text("a6d44-nyaaa-aaaap-abp7q-cai").expect("principal should be valid");
let (result,) = ic_cdk::api::call::call_with_payment128::<
(RpcServices, Option<RpcConfig>, GetLogsArgs),
(MultiGetLogsResult,),
>(
canister_id,
"eth_getLogs",
(
RpcServices::EthMainnet(None),
None,
GetLogsArgs {
fromBlock: Some(BlockTag::Finalized),
toBlock: Some(BlockTag::Finalized),
addresses: vec!["dummy_address".to_string()],
topics: Some(vec![vec!["topic1".to_string()], vec!["topic2".to_string()]]),
},
),
cycles,
)
.await
.expect("Call failed");
match result {
MultiGetLogsResult::Consistent(_) => send_bitcoin().await,
MultiGetLogsResult::Inconsistent(_) => {
panic!("RPC providers gave inconsistent results")
}
}
}
async fn send_bitcoin() {
ic_cdk::api::management_canister::bitcoin::bitcoin_send_transaction(
ic_cdk::api::management_canister::bitcoin::SendTransactionRequest {
transaction: b"beef".into(),
network: ic_cdk::api::management_canister::bitcoin::BitcoinNetwork::Testnet,
},
)
.await
.expect("Call failed");
}
BUILD on Bitcoin at the speed of ICP. Bitcoin on ICP is not just a future promise, developers are already building incredible use cases.
Bitcoin integrationFull support for Ethereum and other EVM chains is now live allowing ICP smart contracts to augment EVM-based smart contracts with additional functionality.
Ethereum IntegrationSeamless and secure interoperability between different blockchains unlocks new possibilities.
You can utilize ICP’s core tech stack without migrating your smart contract or dapp to ICP. Chain Fusion technology enhances other Web3 ecosystems through unique features like chain-key signing, compute onchain, and HTTPs outcalls, enabling builders to augment their crypto dapps.
ICP Smart contracts can read, write, own, and program multiple tokens across different networks, abstracting complexity away from the user and breaking the silos introduced by scaling solutions.
Seamless cross-chain communication and orchestration. An ICP smart contract can orchestrate your Ethereum dapp's payments to the Bitcoin network, or execute DAO votes autonomously across chains.
Your dapp or smart contract can now offload heavy or expensive compute tasks to ICP without having to migrate your dapp or use an insecure solution.
Explore the integration of Chain Fusion with the Internet Computer through concise code examples and startup collaboration opportunities. Access ready-to-use code snippets and connect with innovative startups to accelerate your projects. Unleash the potential of Chain Fusion and Internet Computer synergy for your next venture.
IC ETH Starter
IC-ETH verifies ETH NFTs, supports main/test nets.
Ordinal Canister
A canister that enables the retrieval of ordinals and their corresponding inscriptions, making them easily accessible on the IC.
OISY
Oisy Wallet: Multichain, ICP-based, manages ETH/ERC20, extendable to BTC/IC.
PoS app for ckBTC
Experimental app showcasing ckBTC use on Internet Computer for POS payments.
Chain-key tokens, like ckBTC, ckETH and ckUSDC, are 1:1 twin tokens backed tokens that enable fast, low-cost, and seamless transfers without third-party intermediaries.
Metaprotocols leverage Chain Fusion to offer decentralized cross-chain infrastructure enabling the transfer of new assets on blockchains.
Decentralized exchanges use Chain Fusion to facilitate trading of assets from different blockchains, providing a uniform user experience.
There are marketplaces for Ordinals and Runes that use Chain Fusion to allow users to purchase or trade efficiently, quickly, and easily.
ICP's native Bitcoin integration and RPC integrations, coupled with a suite of threshold signing protocols open a world of possibilities for developers.
Developers can create smart contracts that interact directly with the Bitcoin mainnet and testnet networks through ICP's direct integration with Bitcoin. The Bitcoin UTXO API allows reading from and writing to the Bitcoin network, e.g. UTXOs and balances or the percentiles of the fees for the last 10'000 transactions.
Read moreThis smart contract enables decentralized RPC integrations with Ethereum and other EVM blockchains. Communication includes obtaining and sending information such as the logs of a specific block or transaction, historical data regarding the network's gas fee, transactions for a specific address, or submitting a signed transaction.
Read moreICP incorporates a suite of threshold signing protocols including ECDSA and Schnorr which allow signing a variety of transactions across chains such as Ethereum and Bitcoin. Further threshold signing protocols like EdDSA and BLS are coming soon.
Read moreHTTPS outcalls can be used to directly obtain off-chain data or interact with off-chain systems, such as Web 2.0 services or enterprise IT infrastructure. For example, oracle services can directly integrate with ICP in a trustless manner, dapps can provide user notifications, or communicate with other chains via RPC endpoints.
Read moreGet all the news and event infos about Chain Fusion Technology on ICP.
Explore more news