i'm working on a Web Application that will allow users to deposit Bitcoin into their own wallet, leading to a service that invests their funds in X(lets say alt-coins).i'm having issues on how to approach this.

So, if i'm not mistaken it will go like this:

Bob deposits BTC to wallet W => W sends to service S => Bob wins money => S sends funds back to W.

Until bob has funds again it takes 2 transactions

If the goal is to minimize fees by reducing the amount of transactions, Would you create a private key for each of the users? or is there a way to create different public addresses that point to the same private key? I Thought about initially giving Bob the option to deposit directly to the service S but the whole idea is giving funds to more than one service.

Thanks for any advice.

  • Sounds like you're making an exchange? Or is it different to that?
    – weston
    Commented Sep 11, 2017 at 16:36
  • different, its a site where you can choose a well known investor to play with your money for you
    – Gilad
    Commented Sep 11, 2017 at 16:49

2 Answers 2


Since your service will control the wallet it is not necessary to do the actual transfer out of the wallet to the service, just show the user a lower balance and do not let them spend or withdraw more than this. This means that your service will have to maintain strict control of the private keys. Also, if you maintain a backend float BTC balance, you can show the user an increased balance immediately without waiting for a return transaction to process. To do this, effectively you will need to control all addresses used by your service. This amounts to virtual wallets.

A note on security, there have been previously several high profile services which hold a balance for users, which have been hacked so you will need to ensure your entire security regime is "A" Grade across your entire organisation.


minimize fees by reducing the amount of transactions

Exchanges do this by not amalgamating withdrawals into large transactions.

See Processing multiple transactions very fast

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.