All Projects → consenlabs → Token Core Ios

consenlabs / Token Core Ios

Licence: apache-2.0
a blockchain private key management library on iOS

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Token Core Ios

Blockchain
区块链、交易所、币种、自媒体、高频交易策略
Stars: ✭ 37 (-95.65%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Awesome Blockchain
⚡️Curated list of resources for the development and applications of blockchain.
Stars: ✭ 937 (+10.24%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Awesome Blockchain
区块链白皮书、书籍、交易所、币种、自媒体等资源汇总 💯
Stars: ✭ 747 (-12.12%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Blockchainage
「区块链技术指北」相关资料。
Stars: ✭ 51 (-94%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Token Core Android
a blockchain private key management library on android
Stars: ✭ 613 (-27.88%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Blockchainwallet Crypto
比特币、以太坊公私钥生成以及签名,长时间不维护可移步 https://github.com/QuincySx/ChainWallet
Stars: ✭ 183 (-78.47%)
Mutual labels:  blockchain, ethereum, bitcoin, eos
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (-42.47%)
Mutual labels:  blockchain, ethereum, bitcoin
Btcpool Abandoned
backend of pool.btc.com
Stars: ✭ 541 (-36.35%)
Mutual labels:  blockchain, ethereum, bitcoin
Multy Back
Back-end of the Multy - mobile multy-blockchain wallet.
Stars: ✭ 26 (-96.94%)
Mutual labels:  blockchain, ethereum, bitcoin
Blockchainstore
💰 Retail Store that runs on Ethereum
Stars: ✭ 425 (-50%)
Mutual labels:  blockchain, ethereum, bitcoin
Wallet Core
Cross-platform, cross-blockchain wallet library.
Stars: ✭ 657 (-22.71%)
Mutual labels:  blockchain, ethereum, bitcoin
Blockchain
블록체인 공부 중입니다.
Stars: ✭ 22 (-97.41%)
Mutual labels:  blockchain, ethereum, bitcoin
Blockchain Reading List
Blockchain Manchester Meetups, Talks and Reading List
Stars: ✭ 17 (-98%)
Mutual labels:  blockchain, ethereum, bitcoin
Simcoin
Blockchain simulation framework with Docker and Python.
Stars: ✭ 470 (-44.71%)
Mutual labels:  blockchain, ethereum, bitcoin
Awesome Blockchain Articles
A collection of awesome blockchain articles. Good learning resources about blockchain.
Stars: ✭ 552 (-35.06%)
Mutual labels:  blockchain, ethereum, bitcoin
Scatterdesktop
Connect to applications on EOS, Ethereum, and Tron. Exchange tokens with ease. Manage your assets safely. All in a simple to use interface.
Stars: ✭ 459 (-46%)
Mutual labels:  blockchain, ethereum, eos
Rotki
A portfolio tracking, analytics, accounting and tax reporting application that protects your privacy
Stars: ✭ 689 (-18.94%)
Mutual labels:  blockchain, ethereum, bitcoin
Blockchain
Compilation of useful documents and scientific papers about Blockchain & cryptocurrencies.
Stars: ✭ 751 (-11.65%)
Mutual labels:  blockchain, ethereum, bitcoin
Aeternity
æternity: solving scalability problems by making sense of state-channels
Stars: ✭ 923 (+8.59%)
Mutual labels:  blockchain, ethereum, bitcoin
Unchained
My personal study of blockchain related technology.
Stars: ✭ 379 (-55.41%)
Mutual labels:  blockchain, ethereum, bitcoin

TokenCore

TokenCore is a blockchain library. TokenCore provides the relatively consistent API that allows you to manage your wallets and sign transactions in BTC, ETH and EOS chains simultaneously. In addition, TokenCore introduces the concept of 'identity', you can use the same mnemonic to manage wallets on the three chains.

Installation

To install TokenCore, use CocoaPods and add this to your Podfile:

pod "TokenCore", git: "https://github.com/consenlabs/token-core-ios.git", branch: "master"

Run the Example

The example show how to manager the wallet and sign transaction, the eos sign will coming soon.

$ cd Example
$ pod install

Try the API

Create new Identity and derive the eth, btc wallets

// You should create or recover Identity first before you create other wallets
do {
  var metadata = WalletMeta(source: .newIdentity)
  metadata.network = Network.mainnet
  metadata.segWit = .p2wpkh // .p2wpkh means that the derived btc wallet is a SegWit wallet
  metadata.name = "MyFirstIdentity"
  let (mnemonic, identity) = try Identity.createIdentity(password: TestData.password, metadata: metadata)
  let ethereumWallet = identity.wallets[0]
  let bitcoinWalelt = identity.wallets[1]
} catch {
  print("createIdentity failed, error:\(error)")
}

Export Wallet

let prvKey = try WalletManager.exportPrivateKey(walletID: ethereumWallet.walletID, password: TestData.password)
print("PrivateKey: \(prvKey)")
let mnemonics = try WalletManager.exportMnemonic(walletID: ethereumWallet.walletID, password: TestData.password)
print("Mnemonic: \(mnemonics)")
let keystore = try WalletManager.exportKeystore(walletID: ethereumWallet.walletID, password: TestData.password)
print("Keystore: \(keystore)")

// output:
// PrivateKey: f653be3f639f45ea1ed3eb152829b6d881ce62257aa873891e06fa9569a8d9aa
// Mnemonic: tide inmate cloud around wise bargain celery cement jungle melody galaxy grocery
// Keystore: {"id":"c7575eba-3ae3-4cc3-86ba-2eb9c6839cad","version":3,"crypto":{"ciphertext":"7083ba3dd5470ba4be4237604625e05fa6b668954d270beb848365cbf6933ec5","mac":"f4f9ea8d42ff348b11fc146c396da446cc975309b3538e08a58c0b218bddd15d","cipher":"aes-128-ctr","cipherparams":{"iv":"db3f523faf4da4f1c6edcd7bc1386879"},"kdf":"pbkdf2","kdfparams":{"dklen":32,"c":10240,"prf":"hmac-sha256","salt":"0ce830e9f888dfe33c31e6cfc444d6f588161c9d4128d4066ee5dfdcbc5d0079"}},"address":"4a1c2072ac67b616e5c578fd9e2a4d30e0158471"}

SignTransaction

let signResult = WalletManager.ethSignTransaction(
        walletID: String,
        nonce: String,
        gasPrice: String,
        gasLimit: String,
        to: String,
        value: String,
        data: String,
        password: String,
        chainID: Int
      )
let signedTx = signResult.signedTx // This is the signature result which you need to broadcast.
let txHahs = signResult.txHash // This is txHash which you can use for locating your transaction record

Troubleshooting

For macOS 10.14 Mojave and Xcode 10, install /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg since Xcode command line tools don't install to /usr/include anymore.

TODO

  • [ ] Test on Objective-C
  • [ ] upgrade the BigInt from 3.0 to 3.1

Copyright and License

  Copyright 2018 imToken PTE. LTD.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

Thanks and more info

Thanks bitcoinj, CoreBitcoin and others library.

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].