Friend of mine was trying to buy BTC from ATM, instead of BTC address he scanned the public key from coinomi wallet (I dont know why the ATM accepted it, but it did). Is it possible to somehow access the BTC? Thanks!
Seems there is a little confusion here: are you talking about private keys or bitcoin address in form af a public key?
Anyway in coinomi wallet you cannot display any kind of uncompressed xPub or similar keys, so he should have sent the funds to a proper BTC address.
Otherwise he tried to send BTC to a private key but this should be impossible by protocol definition. Even if the BTM scanner somehow accepted a priv key as an input the software should recognize the issue and would stop the operation.
Is it possible to somehow access the BTC?
You say the BTM used a public key as a bitcoin-address. That shouldn't be possible but maybe it's a flaw in the BTM software.
You cannot access BTC associated with a bitcoin-address for which you have no corresponding private-key.
You cannot generate or discover a private-key from an address
If what you say is true, that BTC amount has joined the 20% of all BTC that are lost forever.
I don't know about how the specifications of the ATM or the Coinomi wallet, but it is absolutely possible in Bitcoin to send coins to a public key, rather than an address. This is slightly less secure than sending to a never-before-used address (because it exposes the public key), but it's still perfectly fine to do. If that's what happened, then yes it will be possible to spend the bitcoins, as long as your friend has the private key.
To get a bit more technical, a Bitcoin address starting with a 1 is a hash of a public key. When you go to spend bitcoin that has been sent to your address, you must provide both:
- A signature (generated with your private key), proving you own the public key
- The public key itself, proving that it matches the address
When money has been sent to your public key, you don't need to again provide the public key to spend that money; you just need the signature. So as long as you have the private key, it's possible to generate the signature you need to spend the money sent to the public key.
Newbies often make the mistake of confusing bitcoin addresses with public keys. An address is derived from the public key but it isn't the public key. It is a hash plus checksum of the public key. Because it contains a checksum the sender can validate that the address was entered correctly before sending bitcoins to it. Most likely the user is the one who is confused. He supplied a bitcoin address and not a public key. He just doesn't know the right terms to use.