<p>Funds on Bitcoin aren't necessarily locked by a single key.</p>
<p>Each output on the bitcoin blockchain is locked by a <a href="https://en.bitcoin.it/wiki/Script" rel="nofollow noreferrer">Bitcoin Script</a>. To spend an output, you have to provide the correct inputs to the locking script, such that the evaluation is successful (and meets other consensus requirements).</p>
<p>Standard addresses, whether P2PKH, P2WPKH-P2SH, or P2WPKH, require a valid signature from a pre-selected private key.</p>
<p>To prove that you can spend such an output, it suffices to prove that you can produce signatures from that private key - this can be done by signing a message, or spending an output (in the event that multiple outputs are available for the same locking script, spending a single output suffices as proof).</p>
<p>However, there can be other kinds of locking scripts - multi-signature scripts require <code>M of N</code> keys to sign, which in turn would require you to prove that you control at least M of the N keys listed in the locking script.</p>
<p>There are other kinds of scripts, such as timelocks or hashing puzzles, which could require waiting until a pre-determined block height or time, or providing the pre-image to a specific hash. For those cases, you would need to prove your ability to wait, or knowledge of the pre-image (which may be difficult to achieve without sharing the pre-image itself).</p>
<p>More complex scripts (essentially, any scenario that can be represented as a series of Bitcoin Script operations), can be created - with Taproot, you could have multiple branches that allow unlocking of the assets under different scenarios - proving control of those funds would be script specific.</p>
<p>When sharing such proofs, you should be careful - proofs not bound by a signature or a similar value may accidentally reveal all required information to unlock an output - for instance, a script that only requires a pre-image for a specific hash, will be spendable by anyone who knows that pre-image. Thus, sharing that with a third-party, even outside of a transaction, may result in funds being lost.</p>

CC BY-SA 4.0
2024-05-10T01:40:45.743Z
Thank you for your answer. But what you said is too complicated or too theoretical. Actually, I just want to know that in practice, for a wallet in Bitcoin Core, in order to verify whether I have full control over its funds, besides spending it, what specific methods are there? Just as you said, there are various signatures or scripts in various situations. For a novice, a more concise and intuitive verification method is needed. @Raghav Sood
foolbear
CC BY-SA 4.0
2024-05-10T01:50:12.627Z
If you're using a bog standard Bitcoin Core wallet, you fall into the `Standard addresses, whether P2PKH, P2WPKH-P2SH, or P2WPKH` category - to prove you control an address in the wallet, you would need to be able to sign a message with a key corresponding to that address in that wallet. Note that Bitcoin Core uses hardened derivations, so you would have to do this for each address that contains funds (as opposed to proving a single address and then sharing an xpub to show control of sister keys).
Raghav Sood
CC BY-SA 4.0
2024-05-10T01:59:10.270Z
signing/verifying message works for legacy address only, right? what can i do for the non-legacy address(Most of the addresses nowadays are non-legacy) in Bitcoin Core?
foolbear
CC BY-SA 4.0
2024-05-09T13:31:53.090Z
2024-05-09T13:31:53.090Z
Raghav Sood
<p>What's the simplest way to test and verify that I am the owner of the fund except sending a real coin?</p>
<p>In fact, this problem contains two aspects. One is to prove to ourself, and the other is to prove to strangers. Why is it also very important to prove to ourself? Because for a newcomer, it may ask an expert to help set up a wallet and buy some BTCs. Of course, we cannot just think that we has mastered these BTCs just by seeing which number on the bitcoin core.</p>
<p>For legacy address, I think i can verify with signing/verifying(for ourself and stranger) message, is this simplest?</p>
<p>But what can i do for the SegWit address?</p>
<p>How about isMine in getaddressinfo RPC? (for ourself only?)</p>

CC BY-SA 4.0
2024-05-15T07:45:52.017Z
FYI: https://bitcoin.stackexchange.com/questions/75257/how-to-check-ownership-of-wallet-with-segwit-address
foolbear
CC BY-SA 4.0
2024-05-15T08:00:25.693Z
FYI: https://bitcoin.stackexchange.com/questions/116187/with-legacy-bitcoin-addresses-deprecated-will-bitcoin-core-no-longer-be-able-to
foolbear
CC BY-SA 4.0
2024-05-27T13:47:33.977Z
Except sending, I can create/process psbt and analyze, succ if complete = true with 
 no any missing signatures.
foolbear
<bitcoin-core>
What's the simplest way to test and verify that I am the owner of the fund
foolbear
# What's the simplest way to test and verify that I am the owner of the fund

(Asked by: username_0 on 2024-05-09)

What's the simplest way to test and verify that I am the owner of the fund except sending a real coin?

In fact, this problem contains two aspects. One is to prove to ourself, and the other is to prove to strangers. Why is it also very important to prove to ourself? Because for a newcomer, it may ask an expert to help set up a wallet and buy some BTCs. Of course, we cannot just think that we has mastered these BTCs just by seeing which number on the bitcoin core.

For legacy address, I think i can verify with signing/verifying(for ourself and stranger) message, is this simplest?

But what can i do for the SegWit address?

How about isMine in getaddressinfo RPC? (for ourself only?)

**Tags:** bitcoin-core

> **Comments:**
> **username_0**: FYI: https://bitcoin.stackexchange.com/questions/75257/how-to-check-ownership-of-wallet-with-segwit-address  
> **username_0**: FYI: https://bitcoin.stackexchange.com/questions/116187/with-legacy-bitcoin-addresses-deprecated-will-bitcoin-core-no-longer-be-able-to  
> **username_0**: Except sending, I can create/process psbt and analyze, succ if complete = true with   no any missing signatures.  

---

## 1 answers

### Answer by username_1 on 2024-05-09. Score: 3

Funds on Bitcoin aren't necessarily locked by a single key.

Each output on the bitcoin blockchain is locked by a [Bitcoin Script](https://en.bitcoin.it/wiki/Script). To spend an output, you have to provide the correct inputs to the locking script, such that the evaluation is successful (and meets other consensus requirements).

Standard addresses, whether P2PKH, P2WPKH-P2SH, or P2WPKH, require a valid signature from a pre-selected private key.

To prove that you can spend such an output, it suffices to prove that you can produce signatures from that private key - this can be done by signing a message, or spending an output (in the event that multiple outputs are available for the same locking script, spending a single output suffices as proof).

However, there can be other kinds of locking scripts - multi-signature scripts require `M of N` keys to sign, which in turn would require you to prove that you control at least M of the N keys listed in the locking script.

There are other kinds of scripts, such as timelocks or hashing puzzles, which could require waiting until a pre-determined block height or time, or providing the pre-image to a specific hash. For those cases, you would need to prove your ability to wait, or knowledge of the pre-image (which may be difficult to achieve without sharing the pre-image itself).

More complex scripts (essentially, any scenario that can be represented as a series of Bitcoin Script operations), can be created - with Taproot, you could have multiple branches that allow unlocking of the assets under different scenarios - proving control of those funds would be script specific.

When sharing such proofs, you should be careful - proofs not bound by a signature or a similar value may accidentally reveal all required information to unlock an output - for instance, a script that only requires a pre-image for a specific hash, will be spendable by anyone who knows that pre-image. Thus, sharing that with a third-party, even outside of a transaction, may result in funds being lost.

> **Comments:**
> **username_0**: Thank you for your answer. But what you said is too complicated or too theoretical. Actually, I just want to know that in practice, for a wallet in Bitcoin Core, in order to verify whether I have full control over its funds, besides spending it, what specific methods are there? Just as you said, there are various signatures or scripts in various situations. For a novice, a more concise and intuitive verification method is needed. @username_1  
> **username_1**: If you're using a bog standard Bitcoin Core wallet, you fall into the `Standard addresses, whether P2PKH, P2WPKH-P2SH, or P2WPKH` category - to prove you control an address in the wallet, you would need to be able to sign a message with a key corresponding to that address in that wallet. Note that Bitcoin Core uses hardened derivations, so you would have to do this for each address that contains funds (as opposed to proving a single address and then sharing an xpub to show control of sister keys).  
> **username_0**: signing/verifying message works for legacy address only, right? what can i do for the non-legacy address(Most of the addresses nowadays are non-legacy) in Bitcoin Core?  

---

