Jump to content
pompous-p

Good way to *check* if secret key is working?

Recommended Posts

Is there any good way to check if a secret key for a ripple address is working, without 'giving it away' to someone like GateHub, and also without running your own RippleD node?

Share this post


Link to post
Share on other sites
1 hour ago, MrBudgens said:

If by "test" you mean check if it can recover the address you could disconnect from the internet and use the minimalist client:

https://github.com/jatchili/minimalist-ripple-client

yes, this is exactly what I meant, and now that you've reminded me of the jatchili minimalist client, I'm baffled as to how I forgot about it, considering that's what I used to make most of my wallets!!

Share this post


Link to post
Share on other sites

Pretty much any of the web browser wallets here will let you disconnect and verify if the secret matches the account.  

https://www.xrpchat.com/links/

It's part of Ripple's API library that most wallets here use.

The wallet I made will specifically tell you if the secret and address you input don't match, even if you aren't connected to the internet:

https://www.theworldexchange.net/

Edited by pftq

Share this post


Link to post
Share on other sites

If you did want to test it... can you import into Gatehub using secret key, (hope they are honest and wont be hacked and that no key loggers are in your browser) then see the balance.  That would prove the secret key works.  Then delete the wallet off GateHub.

 

My fear of doing it other than the ones I mentioned is:  Would deleting the wallet off Gatehub while it has funds in it set the Wallet to disabled or frozen or somesuch in the Ledger?

Share this post


Link to post
Share on other sites
7 hours ago, Tinyaccount said:

If you did want to test it... can you import into Gatehub using secret key, (hope they are honest and wont be hacked and that no key loggers are in your browser) then see the balance.  That would prove the secret key works.  Then delete the wallet off GateHub.

 

My fear of doing it other than the ones I mentioned is:  Would deleting the wallet off Gatehub while it has funds in it set the Wallet to disabled or frozen or somesuch in the Ledger?

When you remove your account from GateHub, GateHub doesn't delete it immediately. It takes some unspecified amount of time before an account is actually deleted.

 

Share this post


Link to post
Share on other sites
1 minute ago, T8493 said:

When you remove your account from GateHub, GateHub doesn't delete it immediately. It takes some unspecified amount of time before an account is actually deleted.

 

Ah yes that's true....   I believe I read 180 days?   But it will go eventually.  My biggest concern is would you bork the wallet by a Gatehub delete?   Ideally all that happens is Gatehub deletes the record and no longer has the secret key but the wallet remains active and alive.

 

But another possibility is that the delete sets some flag or something in the Ledger and the wallet is now unusable...   anyone know for sure?

Share this post


Link to post
Share on other sites

There's no such thing as "deleting" a wallet.  There are no delete flags or other things that would disable a wallet as long as you keep the keys.

Share this post


Link to post
Share on other sites
Posted (edited)

Signing a transaction with the wrong key will not throw an error. Any other way to verify a secret against an address programatically besides trying to submit the TX and burning XRP in the process?

Edited by Jocelyn
Programatically

Share this post


Link to post
Share on other sites
21 minutes ago, Jocelyn said:

Signing a transaction with the wrong key will not throw an error. Any other way to verify a secret against an address programatically besides trying to submit the TX and burning XRP in the process?

Derive the private key from the secret and calculate the matching public key, then encode it in base58 in Ripple's alphabet and see if it matches.

If you sign a transaction but never submit it, nothing gets burned by the way.

Share this post


Link to post
Share on other sites

For those interested, here it is:

import { deriveKeypair, deriveAddress } from 'ripple-keypairs'

verifyKeyPair(address, secret) {
  const { publicKey } = deriveKeypair(secret)
  const derivedAddress = deriveAddress(publicKey)
  return address == derivedAddress
}

Thanks Sukrim & Wietse

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...