Bitcoin Forum
April 25, 2024, 08:59:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Implement a simple wallet  (Read 388 times)
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 21, 2018, 12:10:41 PM
 #1

I need to implement a simple wallet using bitcore-lib by node.js.
Like manage private/public keys and addresses .

Is there any simple tutorial or example source code to show how to do this?

Thanks.
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714078740
Hero Member
*
Offline Offline

Posts: 1714078740

View Profile Personal Message (Offline)

Ignore
1714078740
Reply with quote  #2

1714078740
Report to moderator
1714078740
Hero Member
*
Offline Offline

Posts: 1714078740

View Profile Personal Message (Offline)

Ignore
1714078740
Reply with quote  #2

1714078740
Report to moderator
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
December 21, 2018, 12:33:46 PM
 #2

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 21, 2018, 02:59:26 PM
 #3

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)

Hi thanks for reply.

If a "lightweight wallet" is what I need to implement,
1, generate key pair and address;
2, issue transaction
3, get balance
4, get exchange rate
are all what I suppose to do, and implement with bitcore-lib,
is there any good guide to show how to implement?



Thanks.

darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
December 21, 2018, 03:08:33 PM
Merited by suchmoon (4)
 #4

Why do you need a guide to do that ? I tried to guide you through the process, just try and then if you have problems you cannot solve I (/we?) can help you.

Quote
1, generate key pair and address;
https://github.com/bitpay/bitcore-lib/blob/master/docs/address.md

Quote
2, issue transaction
https://github.com/bitpay/bitcore-lib/blob/master/docs/transaction.md

The bitcore-lib docs are here to help you and are I think the guide you are looking for.

Quote
4, get exchange rate
Maybe the lib doesn't provide this and so you have to use exchanges APIs.

leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 21, 2018, 03:39:55 PM
 #5

Why do you need a guide to do that ? I tried to guide you through the process, just try and then if you have problems you cannot solve I (/we?) can help you.

Quote
1, generate key pair and address;
https://github.com/bitpay/bitcore-lib/blob/master/docs/address.md

Quote
2, issue transaction
https://github.com/bitpay/bitcore-lib/blob/master/docs/transaction.md

The bitcore-lib docs are here to help you and are I think the guide you are looking for.

Quote
4, get exchange rate
Maybe the lib doesn't provide this and so you have to use exchanges APIs.



Thanks very much for your help.
Initscri
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
December 22, 2018, 01:06:29 AM
 #6

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)

Hi thanks for reply.

If a "lightweight wallet" is what I need to implement,
1, generate key pair and address;
2, issue transaction
3, get balance
4, get exchange rate
are all what I suppose to do, and implement with bitcore-lib,
is there any good guide to show how to implement?



Thanks.



What currency pair are you looking for exchange wise? I can maybe give some info/support regarding exchange APIs

----------------------------------
Web Developer. PM for details.
----------------------------------
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 22, 2018, 09:59:45 AM
 #7

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)

Hi thanks for reply.

If a "lightweight wallet" is what I need to implement,
1, generate key pair and address;
2, issue transaction
3, get balance
4, get exchange rate
are all what I suppose to do, and implement with bitcore-lib,
is there any good guide to show how to implement?



Thanks.



What currency pair are you looking for exchange wise? I can maybe give some info/support regarding exchange APIs

Hi, I know a library named ccxt, almost composited all currencies:
https://github.com/ccxt/ccxt

any comments?
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 22, 2018, 10:12:34 AM
Last edit: December 22, 2018, 12:57:09 PM by leonzh
 #8

One thing I do confuse is that through bitcore-lib, I can implement a wallet, why bitcore and many other apis like blockchaininfo still provide wallet programs which will require at least a rpc call to be functional? Running wallet as an external process and make rpc call could increase the complexity of a project, which I'd rather implement with a internal library(as bitcore-lib).
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
December 22, 2018, 12:13:51 PM
 #9

Quote
Hi, I know a library named ccxt, almost composited all currencies:
https://github.com/ccxt/ccxt

any comments?
I've heard of it but never used it. It seems good.

Quote
One thing I do confuse is that through bitcore-lib, I can implement a wallet, why bitcore and many other apis like blockchaininfo still provide wallet programs which will require at least a rpc call to be function? Running wallet as an extra rpc process could increase the complexity of a project, which I'd rather implement with a internal library(as bitcore-lib).
I don't understand this part :
Quote
which will require at least a rpc call to be function?
If you wonder why use RPC if we have a library which could do a similar thing, then the answer is that to interact with the network you sometimes have to have some informations only a node (at least a SPV) has.
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 22, 2018, 01:23:05 PM
 #10

Quote
Hi, I know a library named ccxt, almost composited all currencies:
https://github.com/ccxt/ccxt

any comments?
I've heard of it but never used it. It seems good.

Quote
One thing I do confuse is that through bitcore-lib, I can implement a wallet, why bitcore and many other apis like blockchaininfo still provide wallet programs which will require at least a rpc call to be function? Running wallet as an extra rpc process could increase the complexity of a project, which I'd rather implement with a internal library(as bitcore-lib).
I don't understand this part :
Quote
which will require at least a rpc call to be function?
If you wonder why use RPC if we have a library which could do a similar thing, then the answer is that to interact with the network you sometimes have to have some informations only a node (at least a SPV) has.

So why I cannot setup a node with library code inside my project? Does a node must be an external program?
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
December 22, 2018, 02:59:39 PM
 #11

Quote
So why I cannot setup a node with library code inside my project? Does a node must be an external program?
Actually every wallet should be a node (or used to be). For convenience lightweight wallets have been implemented (SPV nodes) and you can do that if bitcore-lib permits it, or you can codez it yourself ^^
I still don't understand what you want to do with it.
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
December 22, 2018, 04:24:18 PM
 #12

I need to implement a simple wallet using bitcore-lib by node.js.
Like manage private/public keys and addresses .

Have you checked the already existing open source projects on GitHub?
https://github.com/search?l=JavaScript&q=bitcoin+wallet&type=Repositories

So why I cannot setup a node with library code inside my project? Does a node must be an external program?

A library is a set of functions that are put together by the programmer to serve a purpose. In order for a bitcoin library to have node functionalities it has to have implemented the P2P protocol and also have some wrappers allowing the caller to open up sockets for communication. I haven't had the chance to finish up this myself but it is not that complicated, I've already implemented the protocol part.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Initscri
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
December 22, 2018, 05:54:08 PM
 #13

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)

Hi thanks for reply.

If a "lightweight wallet" is what I need to implement,
1, generate key pair and address;
2, issue transaction
3, get balance
4, get exchange rate
are all what I suppose to do, and implement with bitcore-lib,
is there any good guide to show how to implement?



Thanks.



What currency pair are you looking for exchange wise? I can maybe give some info/support regarding exchange APIs

Hi, I know a library named ccxt, almost composited all currencies:
https://github.com/ccxt/ccxt

any comments?

Looks fine to me, rather well supported/updated & a huge following. I'd go with that for the price portion if you want it to be more advanced.
Although, it may be a tad overkill.

A simple request to https://blockchain.info/ticker will provide prices as well.

----------------------------------
Web Developer. PM for details.
----------------------------------
leonzh (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 23, 2018, 11:14:13 AM
 #14

Hi,

I don't have any "tutorial" nor code simple enough to give you. But I can help you to think about what do you need to implement.
First what is a wallet ? It's an interface to the Bitcoin network.
In order to use it what do you need ? A key pair;
I think you should begin by generating key pairs in different formats (compressed, uncompressed, b58check-encoded, b58check-decoded, WIF-encoded, WIF-decoded, encrypted, etc..)

Hi thanks for reply.

If a "lightweight wallet" is what I need to implement,
1, generate key pair and address;
2, issue transaction
3, get balance
4, get exchange rate
are all what I suppose to do, and implement with bitcore-lib,
is there any good guide to show how to implement?



Thanks.



What currency pair are you looking for exchange wise? I can maybe give some info/support regarding exchange APIs

Hi, I know a library named ccxt, almost composited all currencies:
https://github.com/ccxt/ccxt

any comments?

Looks fine to me, rather well supported/updated & a huge following. I'd go with that for the price portion if you want it to be more advanced.
Although, it may be a tad overkill.

A simple request to https://blockchain.info/ticker will provide prices as well.

For bcoin, its bcoin program will run a node and sync chain data on local machine; but for blockchain.info apis, its wallet program does not require run a node to call api, why?
RedR00t
Newbie
*
Offline Offline

Activity: 140
Merit: 0


View Profile
December 23, 2018, 02:41:44 PM
 #15

I need to implement a simple wallet using bitcore-lib by node.js.
Like manage private/public keys and addresses .

Is there any simple tutorial or example source code to show how to do this?

Thanks.

Bro you can use RPC for do this

https://github.com/Hanminji/BitcoinRPC

just you must keep Bitcoin Node working OR Electrum Wallet in Daemon mood
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
December 24, 2018, 11:34:41 AM
Last edit: December 24, 2018, 12:00:50 PM by darosior
 #16

Quote
Bro you can use RPC for do this

https://github.com/Hanminji/BitcoinRPC

just you must keep Bitcoin Node working OR Electrum Wallet in Daemon mood
You cannot do everything just with RPC : you would have to use `importprivkey` at some point (or generate one) and that's neither secure (you have to trust the node, which generates the private keys, or knows about them) nor convenient (rescanning the funds when importing a private key, or if many people use it having all the pk of all the users on one node).
Moreover we can discuss the utility of doing so : it would just be a graphical interface to the daemon, which is exactly bitcoin-qt.
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!