Skip to content

Extension to BitcoinCore.Swift that makes it usable with BitcoinCash(ABC) network.

License

Notifications You must be signed in to change notification settings

horizontalsystems/BitcoinCashKit.Swift

Repository files navigation

BitcoinCashKit.Swift

BitcoinCashKit.Swift is a package that extends BitcoinCore.Swift and makes it usable with BitcoinCash (ABC) Mainnet and Testnet networks.

Features

  • Base58 and Bech32
  • Validation of BCH hard forks
  • ASERT, DAA, EDA validations

Usage

Because BitcoinCash is a fork of Bitcoin, the usage of this package does not differ much from BitcoinKit.Swift. So here, we only describe some differences between these packages. For more usage documentation, please see BitcoinKit.Swift

Initialization

All BitcoinCash wallets use default BIP44 derivation path where coinType is 145 according to SLIP44. But since it's a fork of Bitcoin, 0 coinType also can be restored.

let seed = Mnemonic.seed(mnemonic: [""], passphrase: "")!

let bitcoinCashKit = try BitcoinCashKit.Kit(
        seed: seed,
        walletId: "unique_wallet_id",
        syncMode: .full,
        networkType: .mainNet(coinType: .type145),
        confirmationsThreshold: 3,
        logger: nil
)

Prerequisites

  • Xcode 10.0+
  • Swift 5+
  • iOS 13+

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/horizontalsystems/BitcoinCashKit.Swift.git", .upToNextMajor(from: "1.0.0"))
]

Example Project

All features of the library are used in example project. It can be referred as a starting point for usage of the library.

License

The BitcoinCashKit toolkit is open source and available under the terms of the MIT License.

About

Extension to BitcoinCore.Swift that makes it usable with BitcoinCash(ABC) network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages