Integrating nBTC on EVM

Nomic supports bridging Bitcoin to EVM-based chains.

Contract Addresses

Nomic's decentralized custody bridging contract can be found at the following contract addresses:

NetworkBridge Contract Address

Ethereum Sepolia

Ethereum Holešky

Ethereum Mainnet

TBA

Berachain bArtio

nBTC on EVM-based chains is issued as an ERC-20 token at the following contract addresses:

NetworkToken Contract Address

Ethereum Sepolia

Ethereum Holešky

Ethereum Mainnet

TBA

Berachain bArtio

Additional network contract addresses will be listed on here in the future, as well as documentation for creating your own customizable deployments in any EVM environment.

Interchain Deposits

Interchain Deposits allow the generation of Bitcoin addresses which commit to a destination on an EVM-based chain, automatically forwarding any received funds as nBTC to a contract on that chain.

The EVM destination may be either:

  • an Ethereum address to receive the nBTC;

  • a contract call to be executed with the received nBTC.

See nomic-bitcoin-js for more information on generating and displaying Bitcoin deposit addresses.

Withdrawing to Bitcoin

Bitcoin may be withdrawn to a Bitcoin address directly via contract calls on EVM-based chains.

First, approve must be called on the token contract (see above table):

web3.eth.abi.encodeFunctionCall({
    name: 'approve',
    type: 'function',
    inputs: [
    {
        type: 'address',
        name: 'spender'
    },
    {
        type: 'uint256',
        name: 'amount'
    }
    ]
}, [tokenContractAddress, usatAmount]);

Next, initiate the withdrawal to a Bitcoin address with a call to the bridge contract:

import { buildDestination } from 'nomic-bitcoin'

let destination = buildDestination({
    bitcoinAddress: 'tb1...'
})

web3.eth.abi.encodeFunctionCall({
    name: 'sendToNomic',
    type: 'function',
    inputs: [
    {
        type: 'address',
        name: '_tokenContract'
    },
    {
        type: 'string',
        name: '_destination'
    },
    {
        type: 'uint256',
        name: '_amount'
    }
    ]
}, [tokenContractAddress, destination, usatAmount]);

Last updated