Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Validate an Address using the Public Key #135

Closed
c4b4d4 opened this issue Apr 6, 2021 · 2 comments
Closed

Validate an Address using the Public Key #135

c4b4d4 opened this issue Apr 6, 2021 · 2 comments

Comments

@c4b4d4
Copy link

c4b4d4 commented Apr 6, 2021

I'm working on a project that uses this library and I'm looking to verify if an Address belongs to a Public Key.

Is this possible with the library? Is this even possible with Cardano?

I could easily do this using the Private Key, but validation is being done on the server-side and I don't want in any way to send the Private Key over the Network in any kind of way.

So how could I know if a pair of Address+Public Key belong together.

@SebastienGllmt
Copy link
Contributor

Just hash the public key and then check if any address has the public key hash as the payment credential (tools like cardano-db-sync provide a payment_cred field for this)
You can look at the address spec in Cardano (cardano-foundation/CIPs#78) to see how to get the payment credential for an address if you're looking to match a specific address.

@c4b4d4
Copy link
Author

c4b4d4 commented Apr 6, 2021

Just hash the public key and then check if any address has the public key hash as the payment credential (tools like cardano-db-sync provide a payment_cred field for this)
You can look at the address spec in Cardano (cardano-foundation/CIPs#78) to see how to get the payment credential for an address if you're looking to match a specific address.

My problem is, this validation needs to happen as well on addresses that have not made a single payment yet on the blockchain. (Newly created addresses).

Already tried to match the Public.hash() with anything available from the BaseAddress, but no luck on finding a validation.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants