Can a bitcoin address be translated into a stacks address?

238 views Asked by At

For a bitcoin address that I have the private key for, is there an equivalent stacks address? For example if I had not used stacks before and someone knew my bitcoin address, could they send an NFT to a certain stacks address that I would already control due to having my bitcoin private key.

1

There are 1 answers

0
janniks On

In theory, yes (for P2PKH).

Stacks addresses are an encoding of the hash of a public-key (as are Bitcoin P2PKH addresses). So they can be translated from/to each other.

e.g. using the c32check npm package


BUT in practice, if somebody were to send an NFT to the Stacks version of your Bitcoin address — the NFT would not show up in your Stacks wallet (using the same seed-phrase).

This is due to the chains using different derivation paths for their accounts.

Using the same seed-phrase:

  • Bitcoin uses the 44'/0' path (or 49'/0')
  • Stacks uses the 44'/5757' path

...to generate the private-keys used for each account address.

Meaning, a Bitcoin wallets' first account address, does NOT translate to the equivalent Stacks wallets' first account address. It rather translates to a different encoding of the same path.

If you are dealing with raw private-keys, everything might work as expected. But if you are using wallets that take a mnemonic/seed-phrase as input, it will likely NOT — even though you control the private-keys "owning" the NFT. You will likely have to dive into code to transfer the NFT to an easier-to-use account — maybe in the future some Stacks wallet might add this feature.