<p>Forget about these APIs, if you're going to build a wallet do it the right way, the non-custodial way.</p>
<p>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.</p>
<p>Here's a spec of the protocol: <a href="https://electrumx.readthedocs.io/en/latest/protocol.html" rel="nofollow noreferrer">https://electrumx.readthedocs.io/en/latest/protocol.html</a></p>
<p>You can generate the RPC calls yourself or you can use a wrapper like <a href="https://github.com/bilthon/electrum-client-ts" rel="nofollow noreferrer">this</a> one.</p>
<p>Then you'll also want something that does key management. For that I'd recommend taking a look at <a href="https://github.com/bitcoinjs/bitcoinjs-lib" rel="nofollow noreferrer">bitcoinjs-lib</a> and all its related libraries.</p>

CC BY-SA 4.0
2022-10-11T01:20:55.323Z
2022-10-11T01:20:55.323Z
Bilthon
<blockquote>
<p><strong>Does this mean i have to run my own bitcoin node and wrap it in a REST API service with something like Node.js?</strong></p>
</blockquote>
<p>AFAIK most <em>self-custodial</em> Bitcoin wallet apps for Android/iOS are <a href="https://bitcoin.stackexchange.com/q/4649/13866">SPV</a> nodes. They don't rely on the user running a full-node on their-own or on other people's computers.</p>
<p>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.</p>

CC BY-SA 4.0
2022-05-13T15:42:36.987Z
2022-05-13T15:58:06.823Z
2022-05-13T15:58:06.823Z
RedGrittyBrick
<p>I've also been researching wallet development lately. From what I've gathered it looks like this:</p>
<p>your wallet &lt;-&gt; SPV &lt;-&gt; full node</p>
<p>With the language of communication being RPC. You shouldn't need any dedicated libraries other than an RPC/HTTP request handler.</p>

CC BY-SA 4.0
2023-11-07T10:14:37.113Z
2023-11-07T10:14:37.113Z
13fcali
<p>I am looking for a way to build a Bitcoin wallet native mobile application for iOS &amp; Android.</p>
<p>I want the app to offer the following features to its users;</p>
<ul>
<li>Create a new wallet (self custodial)</li>
<li>Create new addresses to receive bitcoin</li>
<li>Send bitcoin</li>
<li>Display wallet balance</li>
</ul>
<p>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).</p>
<p>I have googled around for a &quot;bitcoin wallet NodeJs API&quot; but what got me confused was that all the API's with a &quot;wallet integration&quot; don't seem to offer wallet generation. They offer &quot;new wallet address&quot; generation instead which is one level above what i'm looking for. API examples i found:</p>
<ul>
<li><a href="https://cryptoapis.io" rel="nofollow noreferrer">https://cryptoapis.io</a></li>
<li><a href="https://www.blockcypher.com" rel="nofollow noreferrer">https://www.blockcypher.com</a></li>
<li><a href="https://www.blockchain.com/api/blockchain_wallet_api" rel="nofollow noreferrer">https://www.blockchain.com/api/blockchain_wallet_api</a></li>
</ul>
<p>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?</p>
<p>Does this mean i have to run my own bitcoin node and wrap it in a REST API service with something like Node.js?</p>
<p>I would appreciate if someone could explain and point me in the right direction. Thank you.</p>

CC BY-SA 4.0
2022-05-13T15:27:34.773Z
Why do you need an API? Doesn't a self custodial wallet app only need to speak the Bitcoin network protocol?
RedGrittyBrick
CC BY-SA 4.0
2022-05-13T15:30:30.763Z
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.
Eli Himself
CC BY-SA 4.0
2022-05-13T15:31:21.410Z
You use SPV as Nakamoto intended.
RedGrittyBrick
CC BY-SA 4.0
2022-05-13T15:33:17.477Z
[What is SPV](https://bitcoin.stackexchange.com/q/4649/13866)
RedGrittyBrick
<bitcoin-core><node.js>
How to build a simple Bitcoin Wallet
Eli Himself
# How to build a simple Bitcoin Wallet

(Asked by: username_0 on 2022-05-13)

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:

* <https://cryptoapis.io>
* <https://www.blockcypher.com>
* <https://www.blockchain.com/api/blockchain_wallet_api>

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.

**Tags:** bitcoin-core, node.js

> **Comments:**
> **username_1**: Why do you need an API? Doesn't a self custodial wallet app only need to speak the Bitcoin network protocol?  
> **username_0**: 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.  
> **username_1**: You use SPV as Nakamoto intended.  
> **username_1**: [What is SPV](https://bitcoin.stackexchange.com/q/4649/13866)  

---

## 3 answers

### Answer by username_2 on 2022-10-11. Score: 1

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](https://github.com/username_2/electrum-client-ts) one.

Then you'll also want something that does key management. For that I'd recommend taking a look at [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) and all its related libraries.


---

### Answer by username_1 on 2022-05-13. Score: 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](https://bitcoin.stackexchange.com/q/4649/13866) 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.


---

### Answer by username_3 on 2023-11-07. Score: 0

I've also been researching wallet development lately. From what I've gathered it looks like this:

your wallet <-> SPV <-> full node

With the language of communication being RPC. You shouldn't need any dedicated libraries other than an RPC/HTTP request handler.


---

