Skip to content

AtomicFinance/bitcoin-abstraction-layer

Repository files navigation

Bitcoin Abstraction Layer

⚠️ This project is under heavy development. Expect bugs & breaking changes.

Query different blockchains with account management using a single and simple interface.

Dependencies

This repository is a standalone project based off of Chainify, with heavy modifications to the core Bitcoin wallet libaries. There are no dependencies on the upstream project.

Chain Support

Bitcoin:

bitcoin-cfd-provider bitcoin-dlc-provider bitcoin-wallet-provider

Packages

Package Version
@atomicfinance/bitcoin-cfd-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-dlc-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-esplora-api-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-esplora-batch-api-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-js-wallet-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-utils Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-wallet-provider Bitcoin-Abstraction-Layer
@atomicfinance/client Bitcoin-Abstraction-Layer
@atomicfinance/jsonrpc-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-rpc-provider Bitcoin-Abstraction-Layer
@atomicfinance/bitcoin-node-wallet-provider Bitcoin-Abstraction-Layer
@atomicfinance/provider Bitcoin-Abstraction-Layer
@atomicfinance/types Bitcoin-Abstraction-Layer
@atomicfinance/utils Bitcoin-Abstraction-Layer
@atomicfinance/crypto Bitcoin-Abstraction-Layer
@atomicfinance/errors Bitcoin-Abstraction-Layer
@atomicfinance/node-provider Bitcoin-Abstraction-Layer

DLC Spec Compliance

@atomicfinance/bitcoin-dlc-provider builds on @node-dlc/messaging, @node-dlc/core and cfd-dlc-js and adds wallet support for some parts of the Dlc Specification.

Implemented features:

  • Dlc Offer, Accept, Sign message generation support, including utxo selection and validation
  • Finalize and broadcast Dlc Sign message support
  • Execute and Refund support
  • Mutual Close support
  • HyperbolaPayoutCurve payout generation support
  • DigitDecompositionEventDescriptor support
  • ContractInfo V0 and V1 support
  • ContractDescriptorV1 support

Missing features:

  • PolynomialPayoutCurve payout generation support
  • EnumEventDescriptor support
  • ContractInfoV1 support
  • ContractDescriptorV0 support

Usage

import Client from '@atomicfinance/client'
import BitcoinCfdProvider from '@atomicfinance/bitcoin-cfd-provider'
import BitcoinDlcProvider from '@atomicfinance/bitcoin-dlc-provider'
import BitcoinWalletProvider from '@atomicfinance/bitcoin-wallet-provider'
import BitcoinJsWalletProvider from '@atomicfinance/bitcoin-js-wallet-provider'
import BitcoinNetworks from 'bitcoin-networks'

const network = BitcoinNetworks.bitcoin_testnet

const bitcoin = new Client()
bitcoin.addProvider(new BitcoinJsWalletProvider({
	network,
	mnemonic: 'mnemonic_here',
	baseDerivationPath: `m/84'/${network.coinType}'/0'`,
	addressType: 'bech32',
}))
bitcoin.addProvider(new BitcoinCfdProvider(network));
bitcoin.addProvider(new BitcoinDlcProvider(network));
bitcoin.addProvider(new BitcoinWalletProvider(network));

const offerMessage = await alice.dlc.createDlcOffer(...)

Development

yarn install
yarn bootstrap
yarn watch

Changeset Versioning

We use changesets to manage versioning and changelogs. When creating a pull request, include a summary of your changes in a changeset by running:

yarn changeset

To bump the packages to the proper semantic version and publish:

yarn version
yarn publish

Production

yarn build

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages