Bitcoin Forum
May 11, 2024, 10:33:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can I implement wallets for my users?  (Read 1035 times)
MoltenMelon (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 20, 2015, 08:03:53 PM
 #1

I'm pretty new to Bitcoin, so, excuse me if this is a very basic question.

I'm coding a site in which an user must be able to deposit into an account, and basically spend/earn bitcoin in there. I assume I need to create a wallet for each user, but how can I achieve this? I'm struggling to find a way, or even documentation.
I've found Blockchain's API in here: https://blockchain.info/api/create_wallet, which I assume is what I want, but then again, I'm not sure if I'm getting it.

So, in a nutshell, this is the functionality I'm looking for:

1. Being able to create a wallet for each user
2. That the user is able to deposit/withdraw to and from their wallet.
3. Through the in-site UI, that the user is be able to purchase services and/or earn Bitcoin (which would imply being able to make transactions on behalf of the user)


I'm guessing, from what I've read, that I could use bitcoind, but since I'm new to this, I would guess that I might commit mistakes that make the service vulnerable to hackers.

So my questions are:
1. Is Blockchain's Create Wallet API, the way to go? And if it is, is it reliable and secure?
2. How difficult would it be to implement this on my own? Is it secure and possible to do so with bitcoind? Where can I find the documentation for this?
3. Do you have any other suggestions as to how I can achieve something like this, learning resources, documentation I should read, etc?


My server is running on Node.js, by the way.

I'm just looking for advice so I can move in the right direction, thank you.
1715466808
Hero Member
*
Offline Offline

Posts: 1715466808

View Profile Personal Message (Offline)

Ignore
1715466808
Reply with quote  #2

1715466808
Report to moderator
1715466808
Hero Member
*
Offline Offline

Posts: 1715466808

View Profile Personal Message (Offline)

Ignore
1715466808
Reply with quote  #2

1715466808
Report to moderator
1715466808
Hero Member
*
Offline Offline

Posts: 1715466808

View Profile Personal Message (Offline)

Ignore
1715466808
Reply with quote  #2

1715466808
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
GWGoods
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
June 21, 2015, 01:12:56 AM
 #2

A few ways.


1) You could create a new wallet for each user. Something like https://www.blocktrail.com/ works best for that. Not sure how change addresses work though. I havnt looked into it.

2) How I usually do for customers... Use one wallet with all funds in, Use a Database to determine how much each user has by user id, only allow user to withdraw that much.
MoltenMelon (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 21, 2015, 04:09:09 AM
 #3

Thanks! I will check out blocktrail, but I hadn't considered the second option, and I think that it might be more straightforward. I've been looking into bitcoind and bitcoind accounts, but found that they aren't really scalable, and blockchain hasn't replied with the API key, so I guess I will check out the other options. Thank you again.
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
June 21, 2015, 04:56:13 AM
 #4

Thanks! I will check out blocktrail, but I hadn't considered the second option, and I think that it might be more straightforward. I've been looking into bitcoind and bitcoind accounts, but found that they aren't really scalable, and blockchain hasn't replied with the API key, so I guess I will check out the other options. Thank you again.

You don't need an API key for blockchain.info

You can do what you want with their wallet API and a database.
You could also use BlockCypher API does require API key, if you don't like blockchain.info.
When each user registers you will assign them an address that they can deposit to.
Create a callback with blockchain or blockcypher each time a payment is received you can update their balance in the database.

jim618
Legendary
*
Offline Offline

Activity: 1708
Merit: 1066



View Profile WWW
June 21, 2015, 11:37:41 AM
 #5

You might also want to check out BIP21 (bitcoin URIs) and BIP70 (payment protocol) that you can use to provide links/ payment requests to users via browser links.

If you can avoid being custodian of other people's bitcoin but use BIP21/ BIP70 to realise whatever you want your site to do you can save yourself a lot of headaches. If your site doesn't actually control the bitcoins and is, say, a market maker you can sleep a lot easier as your attack surface is much smaller.

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
btcspry
Member
**
Offline Offline

Activity: 132
Merit: 17


View Profile
June 24, 2015, 12:31:04 AM
 #6

If you need help with implementation, PM me and I could help you set it up.  I offer bitcoin consultation services, so we could probably get your site set up quickly!
icanscript
Hero Member
*****
Offline Offline

Activity: 686
Merit: 502



View Profile
June 24, 2015, 03:44:43 AM
 #7

Hi,

As GWGoods said, Implementation with a single wallet and a database usually works best, I have done this on many customer sites.

Please let me know if you would like help with Implementation.
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!