Source code for SPV node on iOS - where to start?

3

2

I'm working on a proof-of-concept for a blockchain project and at its core it will need a modified SPV node running on iOS. The reason I need to modify it is so I can build non-standard (e.g. OP_RETURN) scripts without seat-of-the-pants techniques like hacking into the transaction hex.

I'm aware of some basic starting points such as picocoin and libbitcoin which I should be able to compile for iOS. But is there anything else available that would specifically make an SPV node easier to develop on iOS?

Echelon

Posted 2015-05-22T16:55:39.063

Reputation: 153

Answers

3

BreadWallet for iOS is open source, has a permissive license, and uses SPV https://github.com/voisine/breadwallet/blob/78d67870cdb887bab69ffeab8d808a3cb24d3759/BreadWallet/BRPeer.m

Bryan Gmyrek

Posted 2015-05-22T16:55:39.063

Reputation: 46

1I just read an article about this guy. I had no idea he'd open-sourced it - thanks! – Echelon – 2015-05-27T23:07:30.743

2

There are Objective-C libraries for Bitcoin, like CoreBitcoin, but none of them implement an SPV client.

My thinking (I've never developed for iOS, only for android) is that you should use a mature solution, like BitcoinJ, and a tool like J2ObjC to convert it. I think that would give you a faster (in terms of development time) and better-tested solution.

Nick ODell

Posted 2015-05-22T16:55:39.063

Reputation: 27 521

I am using https://github.com/keeshux/BitcoinSPV but I still face 0 wallet balance. Check my question with my full code: https://bitcoin.stackexchange.com/questions/90142/bitcoin-spv-not-able-to-fetch-transactions

– Paresh Thakor – 2019-09-12T01:47:05.993

Thanks for the CoreBitcoin suggestion Nick. Not sure about converting a Java codebase though... I've had pain with that kind of thing in the past, because the resultant code is often quite hard to work with. – Echelon – 2015-05-22T19:17:49.960

2

I have found this iOS SPV client library: https://github.com/keeshux/BitcoinSPV

Echelon

Posted 2015-05-22T16:55:39.063

Reputation: 153