Author

Topic: Implement a simple wallet (Read 414 times)

sr. member
Activity: 279
Merit: 435
December 24, 2018, 06:34:41 AM
#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.
newbie
Activity: 140
Merit: 0
December 23, 2018, 09:41:44 AM
#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
newbie
Activity: 10
Merit: 0
December 23, 2018, 06: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?
hero member
Activity: 1582
Merit: 759
December 22, 2018, 12: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.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
December 22, 2018, 11:24:18 AM
#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.
sr. member
Activity: 279
Merit: 435
December 22, 2018, 09:59:39 AM
#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.
newbie
Activity: 10
Merit: 0
December 22, 2018, 08:23:05 AM
#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?
sr. member
Activity: 279
Merit: 435
December 22, 2018, 07:13:51 AM
#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.
newbie
Activity: 10
Merit: 0
December 22, 2018, 05:12:34 AM
#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).
newbie
Activity: 10
Merit: 0
December 22, 2018, 04: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?
hero member
Activity: 1582
Merit: 759
December 21, 2018, 08:06:29 PM
#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
newbie
Activity: 10
Merit: 0
December 21, 2018, 10:39:55 AM
#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.
sr. member
Activity: 279
Merit: 435
December 21, 2018, 10:08:33 AM
#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.

newbie
Activity: 10
Merit: 0
December 21, 2018, 09:59:26 AM
#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.

sr. member
Activity: 279
Merit: 435
December 21, 2018, 07:33:46 AM
#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..)
newbie
Activity: 10
Merit: 0
December 21, 2018, 07:10:41 AM
#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.
Jump to: