<blockquote>
  <p>It is often said that if a bitcoin user uses addresses only once, then quantum computer cannot compromise their security since the public key is revealed only when the money are actually spent.</p>
</blockquote>

<p>There's no quantum computing algorithm that can easily find the pre-image of a hash. Therefore, single-use P2SH/P2PKH/P2WSH/P2WPKH addresses are safe. Its not so much to do with single-use. Single-use helps with Privacy, but the hash protects against an adversary with a quantum computer that is capable of breaking ECDSA.</p>

<blockquote>
  <p>But how come an attacker could not detect a transaction, reverse the public key and forge a transaction from the same address with a higher fee before the first transaction is mined?</p>
</blockquote>

<p>This follows from the fact that there's hashing involved while producing bitcoin addresses.</p>

CC BY-SA 4.0
2018-06-28T15:06:28.133Z
When you spend from an address, you reveal the underlying public key which, in turn, a subject to tampering with by QC. That's why single usage [allegedly] protects one from losing money to a QC-wielding adversary. The question is why is it safe when an attacker can use replace-by-fee
Daniel Vartanov
CC BY-SA 4.0
2018-06-28T15:19:12.650Z
Can you provide an attack scenario where an attack uses RBF while reversing a public key so the question is more explicit?
rny
CC BY-SA 4.0
2018-07-17T14:18:44.740Z
sure, consider this:
1. Someone spends coins, reveals public key
2. While transaction is not mined, an attacker reverts the public key
3. The attacker issues a fraud transaction with a higher fee
4. Attacker gets all the money, the victim is left with nothing.

How single usage of an address helps?
Daniel Vartanov
CC BY-SA 4.0
2018-07-17T21:48:12.563Z
resistance to doublespend is orthogonal to resistance to a quantum computer, since spending a single-usage address immediately reveals the public key (you immediately lose all protections against an adversary with a quantum computer).
rny
CC BY-SA 4.0
2018-06-22T08:17:06.917Z
2018-06-22T08:17:06.917Z
rny
<p>It is often said that if a bitcoin user uses addresses only once, then quantum computer cannot compromise their security since the public key is revealed only when the money are actually spent.</p>

<p>But how come an attacker could not detect a transaction, reverse the public key and forge a transaction from the same address with a higher fee before the first transaction is mined?</p>

<quantum-computing>
How single usage of bitcoin address is resistant to quantum computing _and_ replace-by-fee?
Daniel Vartanov
# How single usage of bitcoin address is resistant to quantum computing _and_ replace-by-fee?

(Asked by: username_0 on 2018-06-22)

It is often said that if a bitcoin user uses addresses only once, then quantum computer cannot compromise their security since the public key is revealed only when the money are actually spent.

But how come an attacker could not detect a transaction, reverse the public key and forge a transaction from the same address with a higher fee before the first transaction is mined?

**Tags:** quantum-computing


---

## 1 answers

### Answer by username_1 on 2018-06-22. Score: 1

> It is often said that if a bitcoin user uses addresses only once, then quantum computer cannot compromise their security since the public key is revealed only when the money are actually spent.

There's no quantum computing algorithm that can easily find the pre-image of a hash. Therefore, single-use P2SH/P2PKH/P2WSH/P2WPKH addresses are safe. Its not so much to do with single-use. Single-use helps with Privacy, but the hash protects against an adversary with a quantum computer that is capable of breaking ECDSA.

> But how come an attacker could not detect a transaction, reverse the public key and forge a transaction from the same address with a higher fee before the first transaction is mined?

This follows from the fact that there's hashing involved while producing bitcoin addresses.

> **Comments:**
> **username_0**: When you spend from an address, you reveal the underlying public key which, in turn, a subject to tampering with by QC. That's why single usage [allegedly] protects one from losing money to a QC-wielding adversary. The question is why is it safe when an attacker can use replace-by-fee  
> **username_1**: Can you provide an attack scenario where an attack uses RBF while reversing a public key so the question is more explicit?  
> **username_0**: sure, consider this: 1. Someone spends coins, reveals public key 2. While transaction is not mined, an attacker reverts the public key 3. The attacker issues a fraud transaction with a higher fee 4. Attacker gets all the money, the victim is left with nothing.  How single usage of an address helps?  
> **username_1**: resistance to doublespend is orthogonal to resistance to a quantum computer, since spending a single-usage address immediately reveals the public key (you immediately lose all protections against an adversary with a quantum computer).  

---

