Bitcoin Forum
May 02, 2024, 02:16:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to start wallet development?  (Read 358 times)
adamcro (OP)
Member
**
Offline Offline

Activity: 276
Merit: 23


View Profile
January 31, 2022, 06:58:00 PM
Last edit: January 31, 2022, 07:14:10 PM by adamcro
Merited by vapourminer (1), Welsh (1), NotATether (1)
 #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?

1714659392
Hero Member
*
Offline Offline

Posts: 1714659392

View Profile Personal Message (Offline)

Ignore
1714659392
Reply with quote  #2

1714659392
Report to moderator
1714659392
Hero Member
*
Offline Offline

Posts: 1714659392

View Profile Personal Message (Offline)

Ignore
1714659392
Reply with quote  #2

1714659392
Report to moderator
1714659392
Hero Member
*
Offline Offline

Posts: 1714659392

View Profile Personal Message (Offline)

Ignore
1714659392
Reply with quote  #2

1714659392
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5818


not your keys, not your coins!


View Profile WWW
February 01, 2022, 01:06:25 AM
Merited by pooya87 (2), ABCbits (2), BlackHatCoiner (2), dkbit98 (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10524



View Profile
February 01, 2022, 03:32:25 AM
Merited by Quickseller (20), WhyFhy (5), ABCbits (2), BlackHatCoiner (2), n0nce (2), vapourminer (1)
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7447


Crypto Swap Exchange


View Profile
February 01, 2022, 12:50:02 PM
Merited by pooya87 (2), BlackHatCoiner (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
rot13maximalist
Newbie
*
Offline Offline

Activity: 5
Merit: 6


View Profile
February 01, 2022, 01:48:57 PM
 #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.
dewez
Copper Member
Member
**
Offline Offline

Activity: 220
Merit: 64

l0tt0.com


View Profile WWW
May 26, 2023, 11:14:13 PM
Last edit: May 26, 2023, 11:27:06 PM by dewez
Merited by vapourminer (2)
 #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

⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎            l0tt0.com            ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎
B I T C O I N   G A M E S   L I K E   Y O U ' V E   N E V E R   S E E N !
⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          UNIQUE GAMES  |  NO KYC  |  WITHDRAW IN MINUTES          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎
Cricktor
Hero Member
*****
Offline Offline

Activity: 756
Merit: 1110


Crypto Swap Exchange


View Profile
May 27, 2023, 10: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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
dewez
Copper Member
Member
**
Offline Offline

Activity: 220
Merit: 64

l0tt0.com


View Profile WWW
May 29, 2023, 01:00:28 PM
 #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

⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎            l0tt0.com            ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎
B I T C O I N   G A M E S   L I K E   Y O U ' V E   N E V E R   S E E N !
⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎          UNIQUE GAMES  |  NO KYC  |  WITHDRAW IN MINUTES          ⚫︎  ⚫︎  ⚫︎  ⚫︎  ⚫︎
She shining
Jr. Member
*
Offline Offline

Activity: 38
Merit: 24


View Profile
June 03, 2023, 04:51:00 PM
 #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.
Zoomic
Sr. Member
****
Offline Offline

Activity: 434
Merit: 252


My post made philipma1957 wear signature


View Profile
June 04, 2023, 04:06:58 PM
 #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.

Flexystar
Full Member
***
Offline Offline

Activity: 1092
Merit: 227



View Profile
June 16, 2023, 08: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?
WhyFhy
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
June 23, 2023, 12:44:59 PM
 #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!

  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
Cricktor
Hero Member
*****
Offline Offline

Activity: 756
Merit: 1110


Crypto Swap Exchange


View Profile
June 23, 2023, 07: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?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Flexystar
Full Member
***
Offline Offline

Activity: 1092
Merit: 227



View Profile
June 26, 2023, 12:25:52 PM
 #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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!