4 Star 1 Fork 0

Gitee 极速下载 / corebitcoin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/oleganza/CoreBitcoin
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
WTFPL

CoreBitcoin

CoreBitcoin implements Bitcoin protocol in Objective-C and provides many additional APIs to make great apps.

CoreBitcoin deliberately implements as much as possible directly in Objective-C with limited dependency on OpenSSL. This gives everyone an opportunity to learn Bitcoin on a clean codebase and enables all Mac and iOS developers to extend and improve Bitcoin protocol.

Do not confuse this with "Bitcoin Core" (previously known as BitcoinQT or "Satoshi client") — the CoreBitcoin is stylized after Apple frameworks (like CoreAnimation and CoreFoundation), and was named this way in 2013, while Bitcoin-QT was renamed into Bitcoin Core in 2014.

Projects using CoreBitcoin

Features

See also Release Notes.

Currency tools

  • Bitcoin currency formatter with support for BTC, mBTC, bits (BTCNumberFormatter).
  • Currency converter (not linked to any exchange) with support for various methods to calculate exchange rate (BTCCurrencyConverter).
  • Various price sources and abstract interface for adding new ones (BTCPriceSource with support for Winkdex, Coindesk, Coinbase, Paymium).

Advanced features

  • Deterministic RFC6979-compliant ECDSA signatures.
  • Script evaluation machine to actually validate individual transactions (BTCScriptMachine).
  • Blind signatures implementation (BTCBlindSignature).
  • Math on elliptic curves: big numbers, curve points, conversion between keys, numbers and points (BTCBigNumber, BTCCurvePoint).
  • Various cryptographic primitives like hash functions and AES encryption (see BTCData.h).

On the roadmap

See all todo items.

  • Complete support for blocks and block headers.
  • SPV mode and P2P communication with other nodes.
  • Full blockchain verification procedure and storage.
  • Importing BitcoinQT, Electrum and Blockchain.info wallets.
  • Support for libsecp256k1 in addition to OpenSSL.
  • Eventual support for libconsensus as it gets more mature and feature-complete.

The goal is to implement everything useful related to Bitcoin and organize it nicely in a single powerful library. Pull requests are welcome.

Starting points

To encode/decode addresses see BTCAddress.

To perform cryptographic operations, use BTCKey, BTCBigNumber and BTCCurvePoint. BTCKeychain implements BIP32 (hierarchical deterministic wallet).

To fetch unspent coins and broadcast transactions use one of the 3rd party APIs: BTCBlockchainInfo (blockchain.info) or Chain-iOS (recommended).

For full wallet workflow see BTCTransaction+Tests.m (fetch unspent outputs, compose a transaction, sign inputs, verify and broadcast).

For multisignature scripts usage see BTCScript+Tests.m: compose and unlock multisig output.

All other files with +Tests in their name are worth checking out as they contain useful sample code.

Using CoreBitcoin CocoaPod (recommended)

Add this to your Podfile:

pod 'CoreBitcoin', :podspec => 'https://raw.github.com/oleganza/CoreBitcoin/master/CoreBitcoin.podspec'

Run in Terminal:

$ pod install

Include headers:

#import <CoreBitcoin/CoreBitcoin.h>

If you'd like to use categories, include different header:

#import <CoreBitcoin/CoreBitcoin+Categories.h>

Using CoreBitcoin.framework

Clone this repository and build all libraries:

$ ./update_openssl.sh
$ ./build_libraries.sh

Copy iOS or OS X framework located in binaries/iOS or binaries/OSX to your project.

Include headers:

#import <CoreBitcoin/CoreBitcoin.h>

There are also raw universal libraries (.a) with headers located in binaries/include, if you happen to need them for some reason. Frameworks and binary libraries have OpenSSL built-in. If you have different version of OpenSSL in your project, consider using CocoaPods or raw sources of CoreBitcoin.

Swift

We love Swift and design the code to be compatible with Swift. That means using modern enums, favoring initializers over factory methods, avoiding obscure C features etc. You are welcome to try using CoreBitcoin from Swift, please file bugs if you have problems.

Swift is awesome to write crypto in it (due to explicit optionals, generics and first-class structs) and we would love to rewrite the entire CoreBitcoin and even relevant portions of OpenSSL in it. Unfortunately, for a year or two it's just out of the question due to instability. And then, using Swift-only features on the API level would mean that Objective-C code wouldn't be able to use CoreBitcoin. Given that, in the medium term we will focus solely on Objective-C implementation compatible with Swift. When everyone jumps exclusively on Swift, we'll make a complete rewrite.

Contribute

Feel free to open issues, drop us pull requests or contact us to discuss how to do things.

Follow existing code style and use 4 spaces instead of tabs. Methods have opening braces on a new line. There's no line width limit.

Email: oleganza@gmail.com

Twitter: @oleganza

To publish on CocoaPods:

$ pod trunk push --verbose --use-libraries

License

Released under WTFPL (except for OpenSSL). Have a nice day.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2014 Oleg Andreev <oleganza@gmail.com> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.

简介

暂无描述 展开 收起
WTFPL
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors/corebitcoin.git
git@gitee.com:mirrors/corebitcoin.git
mirrors
corebitcoin
corebitcoin
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891