The basis of the math to demonstrate ownership of a private key is found at https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch06.asciidoc#ecdsa-math.
For demonstrative purposes, let's assume the wallet has one of the absolute worst hexadecimal encoded private keys possible 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff
Associated WIF encoded compressed private key:
% echo 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff | sed 's/$/01/' | bx base58check-encode -v 128
Associated compressed public address:
% echo 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff | bx ec-to-public | bx ec-to-address -v 0
Given the data above with the private key remaining tightly controlled (private), the following two commands can without out any doubt provide solid proof that the wallet holder truly has custodianship of the private keys without the need to share the companion public key to the private key:
The challenger can create a random phrase to challenge the person claiming to have custodianship of the the private key above to the associated public address above.
Let's assume the challenge phrase is "Craig Wright is not the real Satoshi!". That phrase is sneaker netted over to the person with the private key and performs this operation.
% echo -n "Craig Wright is not the real Satoshi!" | bx message-sign KwDiDMtpksBAcfyHsVS5XzmirtyjKWSeaeM9U1QppugixMUeKMqp
The signature result of the operation above is then sneaker netted back over to the challenger. The challenger in turn take the public address associated with the private key and performs this operation to confirm private key custodianship.
% echo -n "Craig Wright is not the real Satoshi!" | bx message-validate 1PbStXjfDNBU6FZA2iSeisVWwCFN9GK1eQ H4k3D8jR4efMsAjCs9K/Pt8GB64h83Z07jkV4mERvNUZaYKG2ggWGmfoiJJl1ELh/8j6RikruaVeLWmHdQgeZfU=
The signature is valid.
If either the wrong private key signed signed the message or the message signed is not the same, a message like the following will be conveyed from the last operation:
The signature is not valid.
Trezor and Ledger hardware wallets provide the functionality above.
This is technology is critical for auditing and preventing any centralized custodian from re-hypothecating or fractional reserving resources like stock or currency that are in digital form.
Funds for specified addresses that are vaulted should be audit-able by the true owners of those digital resources with challenge-answer turn around times under a few days. This is critical for confirming Full Reserve Encumbered Custodianship capabilities. We will see is Bakkt provides such an auditing service.