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:...
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 ...
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
...
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. ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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, ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
keypair × 16accounts × 4
seed × 3
transactions × 2
stellar-sdk × 2
java-sdk × 2
key × 2
stellar-core × 1
horizon × 1
javascript-sdk × 1
xlm × 1
payments × 1
ledger × 1
go-sdk × 1
verification × 1
cryptography × 1
android × 1