<p>There are many layers to this question. Also, I'm going to assume using just Bitcoin, for simplicity. For other cryptocurrencies the procedure would be mostly similar with important differences mostly in the backend.</p>

<p>On the Bitcoin layer, the simplest solution would be to have a separate wallet for the website.</p>

<p>On the interface layer, you can have a simple form on your website where the user can input the address when requesting fund withdrawal.</p>

<p>On the backend layer, your website can use any wallet software with an API or CLI, Electrum should be good, but is just an example. This API or CLI could be then invoked to make payments to users.</p>

<p>Your server would necessarily have access to the private keys for the website wallet, therefore security should be an important consideration. The wallet file on the server needs to be protected and the backend of your website must properly check the withdrawal amounts, properly authenticate users and properly mitigate common attacks. If you don't have experience with website security, there are many potential holes that can open avenues for attack. Elaborating on them is beyond the scope of Bitcoin StackExchange. The important precaution would be not to keep more funds than necessary on the website wallet and deposit more as needed, manually, from a wallet on your own computer.</p>

<p>(This answer was edited by author as a result of a discussion in the comments)</p>

CC BY-SA 4.0
2020-05-15T10:57:04.763Z
There is no need for a 'master address', just a wallet that can programatically process withdrawal requests. A master address is just bad privacy for everyone involved.
chytrik
CC BY-SA 4.0
2020-05-15T11:07:44.073Z
That's a valid point, @chytrik. Using a modern wallet with change addresses is much better for privacy, although it doesn't really protect from transaction linking by determined attacker. There are also transaction cost considerations, especially with small amounts of BTC. I don't really think it's a "universally bad" practice, it all depends on the details.
Hubert Jasieniecki
CC BY-SA 4.0
2020-05-15T11:23:21.740Z
Maintaining privacy against a determined attacker is tricky, but re-using an address like that just makes the attackers job unnecessarily easy. Transaction costs are not any different, whether you send wallet top-ups and change to the same address, or new addresses. There is no difference in number of transactions, or byte size of transactions.
chytrik
CC BY-SA 4.0
2020-05-15T12:08:04.573Z
@chytrik I believe that using change addresses may lead to output fragmentation and therefore subsequent transactions will require more than one input, which would definitely make them larger in terms of byte size. I believe I have seen it happen in my own Electrum wallet. Some transactions can easily go to thousands of bytes instead of the usual ~250 bytes per one-to-one transaction. Also, while I would appreciate your answer if I'm mistaken about change addresses, I do believe that this thread is becoming an "extended discussion" and not suitable for comments.
Hubert Jasieniecki
CC BY-SA 4.0
2020-05-15T12:26:53.077Z
the specific address a new UTXO is locked to will not affect the fragmentation of the user’s UTXO set. Multiple UTXOs locked to the same address do not combine, they are still spent individually. So it is the same in either case, no extra cost. Your answer isn’t bad otherwise, I just comment because I hope to see builders of btc infrastructure using best practices, not re-using addresses :)
chytrik
CC BY-SA 4.0
2020-05-15T12:38:32.917Z
OK, now I see that you're right. Thanks for clarifying. I'm with you on that, now that I remember that UTXOs don't combine :) I will also update my answer accordingly, since this aspect is indeed misleading on my part.
Hubert Jasieniecki
CC BY-SA 4.0
2020-05-15T10:47:28.620Z
2020-05-15T12:45:06.287Z
2020-05-15T12:45:06.287Z
Hubert Jasieniecki
<p>We are wondering how we can build a wallet that talks to our website and gives the user the ability to request a withdrawal of his funds. We do not know what is the <strong>right question</strong> for this type of functionality that we want to build is, so any advice would be much appreciated: </p>

<p>The flow would be the following -> 
a: User got rewarded in crypto (BTC, XRP, ETH, LINK) (a digit on the database). 
b: User withdraws his reward to their address.</p>

<p>The reward gets credited to the user's account (simply a digit on the database), and NOT to user's wallet address, as the wallet should NOT generate new addresses for deposits, as we do not want to allow deposits at all.</p>

<p>To help with the explanation, Bitcoin faucet websites have such functionality usually, where you can withdraw your earnings but not deposit funds in them.</p>

<p>Cheers</p>

<wallet><bip32-hd-wallets><ethereum>
Crypto wallet for payments with no deposit
Talking Wealth
# Crypto wallet for payments with no deposit

(Asked by: username_0 on 2020-05-15)

We are wondering how we can build a wallet that talks to our website and gives the user the ability to request a withdrawal of his funds. We do not know what is the **right question** for this type of functionality that we want to build is, so any advice would be much appreciated:

The flow would be the following ->
a: User got rewarded in crypto (BTC, XRP, ETH, LINK) (a digit on the database).
b: User withdraws his reward to their address.

The reward gets credited to the user's account (simply a digit on the database), and NOT to user's wallet address, as the wallet should NOT generate new addresses for deposits, as we do not want to allow deposits at all.

To help with the explanation, Bitcoin faucet websites have such functionality usually, where you can withdraw your earnings but not deposit funds in them.

Cheers

**Tags:** wallet, bip32-hd-wallets, ethereum


---

## 1 answers

### Answer by username_1 on 2020-05-15. Score: 1

There are many layers to this question. Also, I'm going to assume using just Bitcoin, for simplicity. For other cryptocurrencies the procedure would be mostly similar with important differences mostly in the backend.

On the Bitcoin layer, the simplest solution would be to have a separate wallet for the website.

On the interface layer, you can have a simple form on your website where the user can input the address when requesting fund withdrawal.

On the backend layer, your website can use any wallet software with an API or CLI, Electrum should be good, but is just an example. This API or CLI could be then invoked to make payments to users.

Your server would necessarily have access to the private keys for the website wallet, therefore security should be an important consideration. The wallet file on the server needs to be protected and the backend of your website must properly check the withdrawal amounts, properly authenticate users and properly mitigate common attacks. If you don't have experience with website security, there are many potential holes that can open avenues for attack. Elaborating on them is beyond the scope of Bitcoin StackExchange. The important precaution would be not to keep more funds than necessary on the website wallet and deposit more as needed, manually, from a wallet on your own computer.

(This answer was edited by author as a result of a discussion in the comments)

> **Comments:**
> **username_2**: There is no need for a 'master address', just a wallet that can programatically process withdrawal requests. A master address is just bad privacy for everyone involved.  
> **username_1**: That's a valid point, @username_2. Using a modern wallet with change addresses is much better for privacy, although it doesn't really protect from transaction linking by determined attacker. There are also transaction cost considerations, especially with small amounts of BTC. I don't really think it's a "universally bad" practice, it all depends on the details.  
> **username_2**: Maintaining privacy against a determined attacker is tricky, but re-using an address like that just makes the attackers job unnecessarily easy. Transaction costs are not any different, whether you send wallet top-ups and change to the same address, or new addresses. There is no difference in number of transactions, or byte size of transactions.  
> **username_1**: @username_2 I believe that using change addresses may lead to output fragmentation and therefore subsequent transactions will require more than one input, which would definitely make them larger in terms of byte size. I believe I have seen it happen in my own Electrum wallet. Some transactions can easily go to thousands of bytes instead of the usual ~250 bytes per one-to-one transaction. Also, while I would appreciate your answer if I'm mistaken about change addresses, I do believe that this thread is becoming an "extended discussion" and not suitable for comments.  
> **username_2**: the specific address a new UTXO is locked to will not affect the fragmentation of the user’s UTXO set. Multiple UTXOs locked to the same address do not combine, they are still spent individually. So it is the same in either case, no extra cost. Your answer isn’t bad otherwise, I just comment because I hope to see builders of btc infrastructure using best practices, not re-using addresses :)  
> **username_1**: OK, now I see that you're right. Thanks for clarifying. I'm with you on that, now that I remember that UTXOs don't combine :) I will also update my answer accordingly, since this aspect is indeed misleading on my part.  

---

