I am currently only checking if the address is 56 chars long an if it is alphanumeric.

Is there a checksum in an address to verify it.

Are there any other rules ?

3 Answers 3


Stellar uses Ed25519 public/private keys. So you can research that if you want some more details.

If you're using a library (like the JS SDK) it's as simple as calling:


If you want to see the details of how that's implemented, you can see here: https://github.com/stellar/js-stellar-base/blob/master/src/strkey.js#L110

In short: There is a version byte, a payload/data, and a checksum.


The previous answer is correct, but just to be a little more precise about what is going on, Stellar private keys are computed as follows. First, a 35-byte value is computed as follow:

  • The fist byte is 'S' << 3.
  • The next 32 bytes are the Ed25519 private key seed
  • The last two bytes are a CRC16 checksum of the first 33 bytes.

Then the whole thing is encoded using RFC4648 base-32 encoding.


In a <form>, one can use a simple regexp to match the Secret Key value:

    <form onSubmit={onSubmit}>
      <label>Secret Key: </label>
    type='text' id='secretKey' required 
      <button type="submit"> Store</button>
  const onSubmit = event => {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.