Skip to main content
16 votes
Accepted

Which cryptographic algorithm is used to generate the secret and public keys?

Stellar is using Ed25519 public-key signature system. After generating a new key pair (public and private key), both keys are strkey-encoded. strkey works like this: Prepend keys with a version byte:...
Bartek Nowotarski's user avatar
13 votes
Accepted

Does the second letter of the public address having any meaning since it only appears to be one of four characters?

No special meaning, it's just a side effect of base32 encoding: the first byte (8 bits) that is encoded contains the type of the string. A public key has prefix "G" for example. You can see the ...
MonsieurNicolas's user avatar
13 votes
Accepted

What is the best method for key validation?

If you are using Stellar JS SDK, the following method will work for you. import StellarBase from 'stellar-base' if (StellarBase.StrKey.isValidEd25519SecretSeed('SB....4A')) { //secret key is valid ...
Orbit Lens's user avatar
  • 6,896
12 votes

What is the best method for key validation?

If you're just interested in checking whether it's a well-formed key, you can use the following algorithm: Verify that the string starts with "S" Base-32 decode the S... string to get the raw bytes. ...
ZuluCrypto's user avatar
8 votes
Accepted

How to generate a Stellar keypair without the SDKs?

I'm working on a Rust library so I had to implement this as well. If you have a 32 byte secret seed, you can generate the ED25519 keypair using your favorite crypto library. Likewise for public keys ...
Francesco's user avatar
  • 1,386
6 votes
Accepted

Account address string length always 56?

It's always 56 for the current encoding scheme. And there is no intention to change the keypair generation mechanism in the nearest future, as far as I know. The invention of the relatively cheap ...
Orbit Lens's user avatar
  • 6,896
5 votes

Does the second letter of the public address having any meaning since it only appears to be one of four characters?

Firstly check these posts to see how the public address is constructed :- Which cryptographic algorithm is used to generate the secret and public keys? How can I decode Ed25519 addresses to the ...
Ross Ure Anderson's user avatar
3 votes

Account creation on stellarterm

Accounts do not exist until they have received their initial funding with a CreateAccount operation. A payment sent to an account that does not yet exist will fail. A valid payment sent to an account ...
Synesso's user avatar
  • 3,367
3 votes
Accepted

Stellar Java Sdk key validation?

You can use StrKey.decodeStellarAccountId() wrapped with a try-catch block. If the expression throws an exception, the account id is invalid.
Orbit Lens's user avatar
  • 6,896
2 votes

How to verify a Transaction?

You will need to verify the signature against the signing key (account ID). You can take a look at how the compliance server implements signature verification. Copying over the code (Golang) here for ...
nikhils's user avatar
  • 1,080
2 votes

Verifying a transaction

The easiest way is to compare the transaction hashes - if they are the same then it was not modified. Signatures are used to prove that a given user signed a transaction (and actually what is being ...
Paul's user avatar
  • 1,184
1 vote
Accepted

How long is a keypair valid until an account is funded and created?

Short answer: the keypair never expires. Since the public key is essentially a computational result of so called one-way function, the public key can be derived from the secret key itself. Therefore, ...
Orbit Lens's user avatar
  • 6,896
1 vote
Accepted

Verifying a transaction

try to validate the transaction hash tx_hash_32, err := tx.Hash() if err != nil { panic(err) } tx_hash := tx_hash_32[:] err = destinationPair.Verify(tx_hash, txs.E.Signatures[0].Signature) if ...
CR-Soneso's user avatar
1 vote

Random crash upon calling KeyPair.random() on android

DeadObjectException is a side-effect of some other failure. Can you debug the root cause by placing a try-catch-log block around KeyPair.random? Aside #1: The implementation of KeyPair.random is ...
Synesso's user avatar
  • 3,367

Only top scored, non community-wiki answers of a minimum length are eligible