Author

Topic: How to start wallet development? (Read 389 times)

full member
Activity: 1092
Merit: 227
June 26, 2023, 07:25:52 AM
#14
You can also start working with how exactly wallet works and what are different parameters for the same.

I have added few reference documents below which are result of few read out on the internet. Not sure how much it will help but if basics are clear then I think anything is possible really.

You can get started by creating Node.js app [Example repository ]
Mnemonic Improvement Protocol - Since any wallet would start with the creation of phrases, you will need that function to get started with. Either 12 words or 24 words, that will define whether it is going to be 128 or 256 bits long entropy.

Further generations:

Learn about secp256k1 elliptic curve for cryptographic computations

Quote
Ethereum and Bitcoin use the secp256k1 elliptic curve for cryptographic computations. Each account’s public key is derived from a corresponding private key using the Elliptic Curve Digital Signature Algorithm or ECDSA for short. By applying the ECDSA to the private key, we get a 64-byte integer, which is two 32-byte integers that represent X and Y of a point on the secp256k1 elliptic curve, concatenated together. The math behind this algorithm allows software to easily calculate the public key of a given private key, while the reverse process is impossible. One can’t compute the private key of a given public key using ECDSA on the secp256k1 elliptic curve.

Learn about Keccak-256 hashing alghorithm

Quote
To calculate an address from the public key, we need to apply the Keccak-256 hashing alghorithm to the public key and take the last (least significant) 20 bytes of the result.

I might be talking randomness with little learning phase. But here is the article which you should learn in depth to understand how everything runs.
They have also given codes for every step above.

Repository required:

1. 01_newAccount.js
2. 02_restoreWallet.js
3. 03_send.js
4. package.json
5. yarn.lock


References:
1. Add How to Build a Crypto Wallet example
2. How To Build a Crypto Wallet
3. Entropy
4. Keccak-256 hashing alghorithm
5. secp256k1 elliptic curve
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
June 23, 2023, 02:27:32 PM
#13
Better is the gravedigger of good. I'm curious, what does the OP want to do better than existing wallets? I don't see a point if there's no plan or idea to do something substantially better regarding the amount of work the development of a wallet needs. And it has been asked before in this thread, why not start contributing and enhancing existing open-source projects like Electrum or Sparrow or maybe other?
hero member
Activity: 1439
Merit: 513
June 23, 2023, 07:44:59 AM
#12
I don't mean to discourage you but if you have to ask then maybe you shouldn't start creating something as security critical as a wallet.

To start you have to first get a good understanding of bitcoin protocol, specifically the transactions structure and transaction signing.
Then you have to decide what type of wallet you want to create (a wallet built on top of a full node like Armory or a light client using SPV protocol like Electrum or the old MultiBit). Each of them would take you on a different path.
Then you have to become familiar with that protocol (eg. learn bitcoin core capabilities or learn Electrum protocol or create your own SPV protocol) and integrate it into your application.

Well said, Op you might go for open source from the get go. Your wallet will get a lot of support and encouragement approaching it that way. Good luck!
full member
Activity: 1092
Merit: 227
June 16, 2023, 03:10:54 PM
#11
I think they should create a software wallet which will generate the offline paper wallet (kind of) and secure that particular space for that address only. The wallet should not allow users to use the funds until the desired time is passed and also it would turn the private keys visible only after that period of time has been passed. This could be form the best mechanism to use non custodial wallet with additional restrictions to save the bitcoin from getting hacked or stolen in the process. Best for the old people who like to read and write and have patience too. What do you think guys?
sr. member
Activity: 630
Merit: 277
June 04, 2023, 11:06:58 AM
#10
The thread is inactive/not ongoing. Op last came online may 6th 2022, I think they couldn't accept critism on their work. There's no reason for bumping a thread last active since February.
After Op created the topic, he hasn't return to reply anyone here either by saying how helpful the thread was or how disappointed.
It could be that he was discouraged here

I don't mean to discourage you but if you have to ask then maybe you shouldn't start creating something as security critical as a wallet.
People hates truth. But to be honest, wallet development is something big for Op alone to handle. It gives problem to a team let alone an individual.
jr. member
Activity: 38
Merit: 24
June 03, 2023, 11:51:00 AM
#9
The thread is inactive/not ongoing. Op last came online may 6th 2022, I think they couldn't accept critism on their work. There's no reason for bumping a thread last active since February.
copper member
Activity: 234
Merit: 72
l0tt0.com
May 29, 2023, 08:00:28 AM
#8
ehh, for the first wallet dev you just have to grip it and rip it. i learned all that stuff as i built it. its like anyhting else. one thing thats really good to know though... when you are sending/withdrawing btc, update your db table BEFORE you send and sign the transaction. Smiley
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
May 27, 2023, 05:55:57 AM
#7
I've been trying to find how to start with wallet development for BTC and other currencies but I could not find any resources.

This sounds to me you haven't searched enough or have no clue where and what to look at. No offense! There are a bunch of open-source wallet and library projects which you can study and fork or even contribute to.

Question is: what is your goal? What do you want to make differently and presumably better than existing open-source wallets? Do you understand blockchain and coin protocols? Do you understand security models? Do you understand e.g. potential privacy issues of SPV wallets? There are certainly more questions to ask, but I'll stop here now, deliberately.
copper member
Activity: 234
Merit: 72
l0tt0.com
May 26, 2023, 06:14:13 PM
#6
i would say use electrum's jsonrpc. it was my first setup...
if on linux- just apt install electrum, launch daemon and read the docs for setting up a wallet.
i personally don't have my webserver on the same box as my wallets, so i used stunnel4 (client-webserver, server-wallet server) on both boxes to make the call from webserver to wallet server.. since standard rpc calls are cleartext, and if you're sending or signing a transaction you'll be passing your wallet password in the call. it's really just meant for localhost setups.

if you are using php, i can give you some basic code examples; check balace, etc.

it actually took me a super long time building my first site that had deposit/withdraws. speaking of which, for accepting payments blockonomics.co is great. just signup and add your xpub key and you're off.

again, if you need any help lmk.

DEWEZ
newbie
Activity: 5
Merit: 6
February 01, 2022, 08:48:57 AM
#5
I've been playing with this rust library recently: https://bitcoindevkit.org It gives a really nice wallet abstraction (create a wallet struct with descriptors, sync balances using electrum, bitcoin-rpc, or other protocols, then generate some addresses, sign psbts, broadcast transactions, etc). There are libraries in most major languages to abstract out the protocol bits and make it easier to write wallets or other software that has to handle transactions. bitcoinj is a popular java library, for example.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
February 01, 2022, 07:50:02 AM
#4
Depending on your end goal, contribute to or privately modify existing open-source wallet should be better option since you could reuse existing component and avoid create new/re-implement existing standard.
legendary
Activity: 3472
Merit: 10611
January 31, 2022, 10:32:25 PM
#3
I don't mean to discourage you but if you have to ask then maybe you shouldn't start creating something as security critical as a wallet.

To start you have to first get a good understanding of bitcoin protocol, specifically the transactions structure and transaction signing.
Then you have to decide what type of wallet you want to create (a wallet built on top of a full node like Armory or a light client using SPV protocol like Electrum or the old MultiBit). Each of them would take you on a different path.
Then you have to become familiar with that protocol (eg. learn bitcoin core capabilities or learn Electrum protocol or create your own SPV protocol) and integrate it into your application.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
January 31, 2022, 08:06:25 PM
#2
If we say the blockchain is the database, then the API consists of the RPC commands.

For most types of wallets though, you won't want to require 300-500GB of disk space, so you'll want to use the Electrum protocol to connect to nodes that do have said disk space and do hold the entire blockchain.

If you want to have a look at existing so-called 'light wallets', just search for them on GitHub.
As an example, here's Sparrow's repo.
For a mobile one, here's Blue Wallet's repo.
member
Activity: 276
Merit: 23
January 31, 2022, 01:58:00 PM
#1
I've been trying to find how to start with wallet development for BTC and other currencies but I could not find any resources.
Is there any API for it?
Jump to: