1

I am looking for a way to build a Bitcoin wallet native mobile application for iOS & Android.

I want the app to offer the following features to its users;

  • Create a new wallet (self custodial)
  • Create new addresses to receive bitcoin
  • Send bitcoin
  • Display wallet balance

Do i have to run my own Bitcoin Node or is there a good API as a service that i am missing that could help me hit the ground running? (I am looking for a NodeJs API).

I have googled around for a "bitcoin wallet NodeJs API" but what got me confused was that all the API's with a "wallet integration" don't seem to offer wallet generation. They offer "new wallet address" generation instead which is one level above what i'm looking for. API examples i found:

This got me thinking that i must be missing something? Is there a good reason why these well-rounded services are not offering something trivial like a new wallet generation?

Does this mean i have to run my own bitcoin node and wrap it in a REST API service with something like Node.js?

I would appreciate if someone could explain and point me in the right direction. Thank you.

4
  • Why do you need an API? Doesn't a self custodial wallet app only need to speak the Bitcoin network protocol? May 13, 2022 at 15:27
  • So how would that work? You run a 340gb+ node on the Mobile App itself? Surely that can't be it. My first assumption is a bitcoin node is ran on a server and the Mobile app just speaks to it via a REST API. May 13, 2022 at 15:30
  • 1
    You use SPV as Nakamoto intended. May 13, 2022 at 15:31
  • 1
    What is SPV May 13, 2022 at 15:33

2 Answers 2

0

Does this mean i have to run my own bitcoin node and wrap it in a REST API service with something like Node.js?

AFAIK most self-custodial Bitcoin wallet apps for Android/iOS are SPV nodes. They don't rely on the user running a full-node on their-own or on other people's computers.

I don't know about Node.js - it seems to be mostly used for back-end web applications - in which case it isn't something I would choose to implement a mobile SPV wallet. However you may know better.

0

Forget about these APIs, if you're going to build a wallet do it the right way, the non-custodial way.

What you want to see is a library that will allow you to interact with an electrum server. An electrum server is this piece of software that complements the bitcoin core and provide indexes for addresses, or rather script hashes. This is what you'll need to keep track of transactions, UTXOs and thus build a balance.

Here's a spec of the protocol: https://electrumx.readthedocs.io/en/latest/protocol.html

You can generate the RPC calls yourself or you can use a wrapper like this one.

Then you'll also want something that does key management. For that I'd recommend taking a look at bitcoinjs-lib and all its related libraries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.