<p>I think these is only one answer to this question: ask whomever gave you the xpub.</p>
<p>Xpubs define series of keys, but there isn't any implicit contract or understanding about how that should be converted into addresses. The specific index positions to use is one question, but there are others, like what type of address/script to use (P2PKH, P2WPKH, ...). All of these are things you should ask the receiver, as it is ultimately up to them to determine what kinds of transactions they would consider a valid payment.</p>
<p>To make a analogy: the receiver told you where they live, and you owe them money, but they haven't told you anything else. Do they want you to pay to their bank account? Do they want you to put an envelope with cash in the mail? Do they want you to bury a treasury chest with jewels under their lawn at night? All of these are in some shape or form ways that value can be transferred, but arguably you wouldn't go bury a treasury chest in their lawn without even talking to them, and expect them to treat that as a payment.</p>

CC BY-SA 4.0
2021-03-01T10:23:01.187Z
Yes, of course "script", encoding, is asked from the seller i.e. P2PKH, P2WPKH
János
CC BY-SA 4.0
2021-03-01T10:24:29.927Z
Do you think is it any possiblity of interference if I am using the first index with zero balance address choosing strategy?
János
CC BY-SA 4.0
2021-03-01T18:38:07.857Z
If that's what you agree on, sure. Anything is fine, but you can't assume it's implicit.
Pieter Wuille
CC BY-SA 4.0
2021-03-01T00:53:57.753Z
2021-03-01T00:53:57.753Z
Pieter Wuille
<p>We operate a market, there are sellers and buyers. Seller has Hierarchical Deterministic Wallets.  Seller give us the Xpub. Which address should be used as destination, when buyer wants to send money to seller?</p>
<p>I thought I should find the first address that has 0 balance. Do you agree with this strategy?</p>

<address><address-generation><address-reuse>
Which address should be used to send the money as target?
János
# Which address should be used to send the money as target?

(Asked by: username_0 on 2021-02-28)

We operate a market, there are sellers and buyers. Seller has Hierarchical Deterministic Wallets. Seller give us the Xpub. Which address should be used as destination, when buyer wants to send money to seller?

I thought I should find the first address that has 0 balance. Do you agree with this strategy?

**Tags:** address, address-generation, address-reuse


---

## 1 answers

### Answer by username_1 on 2021-03-01. Score: 3 | Accepted answer

I think these is only one answer to this question: ask whomever gave you the xpub.

Xpubs define series of keys, but there isn't any implicit contract or understanding about how that should be converted into addresses. The specific index positions to use is one question, but there are others, like what type of address/script to use (P2PKH, P2WPKH, ...). All of these are things you should ask the receiver, as it is ultimately up to them to determine what kinds of transactions they would consider a valid payment.

To make a analogy: the receiver told you where they live, and you owe them money, but they haven't told you anything else. Do they want you to pay to their bank account? Do they want you to put an envelope with cash in the mail? Do they want you to bury a treasury chest with jewels under their lawn at night? All of these are in some shape or form ways that value can be transferred, but arguably you wouldn't go bury a treasury chest in their lawn without even talking to them, and expect them to treat that as a payment.

> **Comments:**
> **username_0**: Yes, of course "script", encoding, is asked from the seller i.e. P2PKH, P2WPKH  
> **username_0**: Do you think is it any possiblity of interference if I am using the first index with zero balance address choosing strategy?  
> **username_1**: If that's what you agree on, sure. Anything is fine, but you can't assume it's implicit.  

---

