All Projects → essentiaone → Hdwallet

essentiaone / Hdwallet

Licence: mit
Simple Swift library for creating HD cryptocurrencies wallets and working with crypto Coins/ERC20 tokens.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Hdwallet

Multicurrencywallet
Bitcoin, Ethereum, ERC20 crypto wallets with Atomic Swap exchange. Release announce: https://twitter.com/SwapOnlineTeam/status/1321844352369500160
Stars: ✭ 136 (+70%)
Mutual labels:  ethereum, bitcoin, erc20, litecoin, crypto
Gnome Feeder
Profit Trailer Feeder Full Build with Settings
Stars: ✭ 122 (+52.5%)
Mutual labels:  ethereum, bitcoin, litecoin, crypto
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+2545%)
Mutual labels:  ethereum, bitcoin, erc20, crypto
desktop
CoinApp is a simple to use minimal Cryptocurrency Wallet for Ethereum, ERC20 Tokens, Bitcoin and Litecoin built for Windows, Mac and Linux.
Stars: ✭ 60 (-25%)
Mutual labels:  crypto, bitcoin-wallet, litecoin, erc20
Cryptex
Gemini, GDAX, Bitfinex, Poloniex, Binance, Kraken, Cryptopia, Koinex, BitGrail and CoinMarketCap cryptocurrency exchange API clients in Swift / iOS SDK. Check prices and account balances using Sample iOS app.
Stars: ✭ 51 (-36.25%)
Mutual labels:  ethereum, bitcoin, litecoin, crypto
Cryptocurrency Dashboard
Crypto Currency Dashboard Using Twitter 🐦 And Coinmarketcap 🚀 API
Stars: ✭ 54 (-32.5%)
Mutual labels:  ethereum, bitcoin, litecoin, crypto
Crypto Whale Watching App
Python Dash app that tracks whale activity in cryptocurrency markets.
Stars: ✭ 389 (+386.25%)
Mutual labels:  ethereum, bitcoin, litecoin
Simcoin
Blockchain simulation framework with Docker and Python.
Stars: ✭ 470 (+487.5%)
Mutual labels:  ethereum, bitcoin, litecoin
Wallet Core
Cross-platform, cross-blockchain wallet library.
Stars: ✭ 657 (+721.25%)
Mutual labels:  ethereum, bitcoin, crypto
Ta4j
A Java library for technical analysis.
Stars: ✭ 948 (+1085%)
Mutual labels:  ethereum, bitcoin, litecoin
Ta4j Origins
A Java library for technical analysis ***Not maintained anymore, kept for archival purposes, see #192***
Stars: ✭ 354 (+342.5%)
Mutual labels:  ethereum, bitcoin, litecoin
Cryptocurrency Arbitrage
A cryptocurrency arbitrage opportunity calculator. Over 800 currencies and 50 markets.
Stars: ✭ 836 (+945%)
Mutual labels:  ethereum, bitcoin, litecoin
Miner Monitor
Miner, balance, wallet and pool monitoring software
Stars: ✭ 38 (-52.5%)
Mutual labels:  ethereum, bitcoin, erc20
Miningcore
Miningcore is a high-performance Mining-Pool Engine that runs on Linux and Windows and supports a variety of crypto-currencies.
Stars: ✭ 378 (+372.5%)
Mutual labels:  ethereum, bitcoin, litecoin
Crypto Bar
📈 A menu bar app that updates cryptocurrencies prices in real-time
Stars: ✭ 379 (+373.75%)
Mutual labels:  ethereum, bitcoin, litecoin
Qtbitcointrader
Secure multi crypto exchange trading client
Stars: ✭ 520 (+550%)
Mutual labels:  ethereum, bitcoin, crypto
Crypto Arbitrage
Automatic Cryptocurrency Trading Bot using Triangular or Exchange Arbitrages
Stars: ✭ 369 (+361.25%)
Mutual labels:  ethereum, bitcoin, litecoin
Aeternity
æternity: solving scalability problems by making sense of state-channels
Stars: ✭ 923 (+1053.75%)
Mutual labels:  ethereum, bitcoin, crypto
Mydicebot.github.io
★MyDiceBot★ - Ultimate Bitcoin Dice Bot. Bet More, Earn More!
Stars: ✭ 48 (-40%)
Mutual labels:  ethereum, bitcoin, litecoin
Gdax Python Api
GDAX API written in Python3 using async/await
Stars: ✭ 52 (-35%)
Mutual labels:  ethereum, bitcoin, litecoin

Build Status Black Duck Security Risk Badge w/ Version Badge w/ Platform Badge w/ Licence

HDWalletKit

HDWalletKit is a Swift framwork that enables you to create and use bitcoin HD wallet (Hierarchical Deterministic Wallets) in your own app.

You can check if the address generation is working right [here](https://iancoleman.io/bip39/).

Features

  • HD and NonHD wallets support
  • Mnemonic recovery phrease in BIP39
  • Keystore generation
  • Read keystore file
  • Sign ether transaction
  • ERC20 Tokens
  • Sign UTXO based transaction

Installation

CocoaPods

To integrate HDWalletKit into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'HDWalletKit'

Carthage

To install with Carthage, simply add this in your Cartfile:

github "essentiaone/HDWallet"

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

How to use

Generate seed and convert it to mnemonic sentence.

let entropy = Data(hex: "000102030405060708090a0b0c0d0e0f")
let mnemonic = Mnemonic.create(entropy: entropy)
print(mnemonic)
// abandon amount liar amount expire adjust cage candy arch gather drum buyer

let seed = Mnemonic.createSeed(mnemonic: mnemonic)
print(seed.toHexString())

PrivateKey and key derivation (BIP39)

let mnemonic = Mnemonic.create()
let seed = Mnemonic.createSeed(mnemonic: mnemonic)
let privateKey = PrivateKey(seed: seed, coin: .bitcoin)

// BIP44 key derivation
// m/44'
let purpose = privateKey.derived(at: .hardened(44))

// m/44'/0'
let coinType = purpose.derived(at: .hardened(0))

// m/44'/0'/0'
let account = coinType.derived(at: .hardened(0))

// m/44'/0'/0'/0
let change = account.derived(at: .notHardened(0))

// m/44'/0'/0'/0/0
let firstPrivateKey = change.derived(at: .notHardened(0))
print(firstPrivateKey.publicKey.address)

Generate keystore file

let data = "abandon amount liar amount expire adjust cage candy arch gather drum buyer"
let keystore = try! KeystoreV3(data: data, password: "qwertyui")
let encodedKeystoreDaya = (try? keystore?.encodedData())

Open keystore file

let keystore = try! KeystoreV3(data: encodedKeystoreDaya, password: password)
guard let decoded = try? keystore?.getDecriptedKeyStore(password: password) else {
fatalError()
}
print(decoded)

Create your wallet and generate address

let mnemonic = Mnemonic.create()
let seed = Mnemonic.createSeed(mnemonic: mnemonic)
let network: Network = .main(.bitcoin)
let wallet = Wallet(seed: seed, network: network)
let account = wallet.generateAccount()
print(account)

Sign Ethereum transaction by private key

let signer = EIP155Signer()
let rawTransaction1 = EthereumRawTransaction(
    value: Wei("10000000000000000")!,
    to: "0x34205555576717bBdF8158E2b2c9ed64EB1e6B85",
    gasPrice: 99000000000,
    gasLimit: 21000,
    nonce: 2
)
guard let signed = try? signer.hash(rawTransaction: rawTransaction1).toHexString() else { return }
print(signed)

Sign Bitcoin transaction by private key

For getting UTXO you can use (https://github.com/essentiaone/essentia-bridges-api-ios)

let address = try LegacyAddress("1HLqrFX5fYwKriU7LRKMQGhwpz5HuszjnK", coin: .bitcoin)
let utxoWallet = UTXOWallet(privateKey: "Kz9UKkL6bKE92QPxQbPcqkCZTnCyLVyfRNFRSbToNjyb4bx321fh")
let signedTx = try utxoWallet.createTransaction(to: address, amount: 0, utxos: utxos)

Create send ERC20 tokens transaction data

let erc20Token = ERC20(contractAddress: "0x8f0921f30555624143d427b340b1156914882c10", decimal: 18, symbol: "ESS")
let address = "0x2f5059f64D5C0c4895092D26CDDacC58751e0C3C"
let data = try! erc20Token.generateDataParameter(toAddress: address, amount: "3") 

Create get balance ERC20 token transaction data

let erc20Token = ERC20(contractAddress: "0x8f0921f30555624143d427b340b1156914882c10", decimal: 18, symbol: "ESS")
let data = try! erc20Token.generateGetBalanceParameter(toAddress: "2f5059f64D5C0c4895092D26CDDacC58751e0C3C")

Convert non HD PrivateKey to Address

let privateKey = PrivateKey(pk: "L35qaFLpbCc9yCzeTuWJg4qWnTs9BaLr5CDYcnJ5UnGmgLo8JBgk", coin: .bitcoin)
print(privateKey.publicKey.address)
//128BCBZndgrPXzEgF4QbVR3jnQGwzRtEz5

License

WalletKit is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].