πŸ™‹β€β™‚οΈDemonstrate ownership of a tz address (DEPRECATED)

To ask someone to prove that he owns a specific address, you have several options.

Option 1:

Ask the wallet owner to send a transaction to your wallet with a random amount of your choice.

The risk of this method is that the verification will happen on-chain, publicly. Malicious actors could find a way to attack and exploit this process.

Another drawback of this method is that it will cost some XTZ tokens for transaction fees.

Option 2:

Choosing the data to sign

In the situation where sending a transaction is not possible, you can use the tezos-client for that. The first step is to pick the data we want the buyer owning the wallet to sign, it could be the ID of a Hic et Nunc NFT he owns, for example: OBJKT#63886

Converting the data to hexadecimal for the tezos-client

We now need to transform the ID in hexadecimal, for that we can use websites like: https://www.convertstring.com/arrow-up-right

or the following script in linux:

#!/bin/bash

echo '0x'"`echo $1 | hexdump -vC |  awk 'BEGIN {IFS="\t"} {$1=""; print }' | awk '{sub(/\|.*/,"")}1'  | tr -d '\n' | tr -d ' '`" | rev | cut -c 3- | rev

Usage:

Signing the data with the tezos-client

The owner will have to sign the transaction with the tezos-client.

Verifying the signature

Finding the public key

To be able to verify the owner's signature, you need to retrieve its public key. For that you have two options:

  • either ask the owner directly if he knows how to find it,

  • or retrieve it yourself from an explorer by looking for the "Reveal key" operation on the owner address.

To find the key on Tzkt, it would look like this:

RPC JSON View
Reveal public key operation

Importing owner's public key in the client

You now need to import the owner's public key in your tezos-client with the following command:

Verifying the signature

The final step will be to verify that the signature matches the public key of the buyer:

Last updated

Was this helpful?