Skip to main content
28 votes
Accepted

Why does the all 0 public key have a known private key in SR25519 and ED25519?

Yes, it's a consequence of the Edwards curve models used, but secp256k1 is a short Weierstrass curve. Ed25519 has the identity (0,1) in Affine coordinates, meaning (0,1) + (0,1) = (0,1) in Ed25519. ...
Jeff Burdges's user avatar
15 votes
Accepted

How to verify a signature in a Pallet?

Substrate provides a Verify and an IdentifyAccount trait. They work with any signature scheme since they are just traits and can be implemented for different crypto schemata. This is very helpful when ...
Oliver Tale-Yazdi's user avatar
12 votes

Why does the all 0 public key have a known private key in SR25519 and ED25519?

SR25519 is a Schnorr Signature protocol on top of the Ristretto compressed point format of the Ed25519 curve. Bitcoin and Ethereum both use the Secp256k1 elliptic curve. In elliptic-curve cryptography,...
rob's user avatar
  • 2,126
10 votes
Accepted

Convert any address to accountId (in hex)

You have a couple of options. First, if you already have an initialized API in your app - const ADDR = "5DTNtGF2DmZ7QwGxg6n1xWzF6cEokNyNre7mUqpVuozrLxu3" // create a type from this const id ...
Luna's user avatar
  • 321
9 votes
Accepted

Why are sr25519 signatures non-deterministic?

A simple sr25519 signature remains secure even with actively malicious system randomness, and you can pass in your own RngCore to have deterministic test vectors, but.. In future, schnorrkel shall ...
Jeff Burdges's user avatar
9 votes
Accepted

How does Substrate detect the signing scheme when verifying signatures?

It is a SCALE-encoded MultiSignature enum. so in SCALE encoding the first byte tells you which variant the value is. So you will notice that ed25519 signatures always start with 0x00, sr25519 with ...
joepetrowski's user avatar
  • 2,955
6 votes

Accidentally used ETH address to receive token from polkadot

Short answer: Not directly, you have to utilize governance (success not guaranteed). Ethereum uses the Elliptic Curve secp256k1 to derive a public key from a private key, whereas Polkadot uses the ...
sea212's user avatar
  • 549
6 votes
Accepted

How do I verify a signature signed using Polkadot.js app with rust code

The JS side actually operates via WASM (if available, which is 99.99% of the cases). When using WASM it uses the same ed25519_dalek crate you pointed to. Specifically here is the Rust/WASM code it ...
Jaco's user avatar
  • 5,865
5 votes

How to verify a signature in a Pallet?

You can also see fully integrated examples of signature verification in a Pallet with: The claims pallet, which verifies Ethereum Signatures impl<T: Config> Pallet<T> { // Constructs ...
Shawn Tabrizi's user avatar
  • 16.1k
5 votes

verify a signature in pallet

How did you create the signature that you are testing with? I assume you used PolkadotJS? That will not work per default, but can easily be fixed. PolkadotJS has the quirk of wrapping everything in &...
Oliver Tale-Yazdi's user avatar
4 votes
Accepted

Error: Unable to initialise options more than once

We can see here the KeyringOptions which contain the KeyringStore. Those options are what's called by loadAll() in line 326: this.KeyringOptions.init(this). If we then go to see what that init does, ...
Alberto Nicolas Penayo's user avatar
3 votes

verify a signature in pallet

I have met a similar(on ECDSA) problem before. But I'm not sure if this could help you. That takes me a whole night to debug(I think there are some bugs on my code before). Finally, I found the ...
AurevoirXavier's user avatar
  • 10.7k
3 votes

How is a substrate address, or multisig address, calcluated from private key?

The Substrate address is actually derived from the public key: For most networks, the public key associated with an account is how that account is identified on the network and is used as the ...
Bruno's user avatar
  • 8,315
3 votes

Convert Ed25519 signature/pub-key to sr25519

It's not "lossy" but "unspecified". Ristretto is defined as either of two possible encodings of Ed25519. Another Ristretto implementation could chooses the other mapping, which ...
Jeff Burdges's user avatar
2 votes

zk SNARKs based anonymous voting

I know that https://manta.network uses ZK for their solution, so you could see how they have gone about things: https://github.com/Manta-Network/manta-signer. They did a sub0 talk. I am a beginner in ...
Squirrel's user avatar
  • 3,849
2 votes

Convert Ed25519 signature/pub-key to sr25519

I am not a cryptography expert either, so your mileage may vary. Both scheme uses the same elliptic curve, but different sign/verify methods. SR25519 fixes more than one problems with EDDSA signatures ...
wigy's user avatar
  • 375
2 votes
Accepted

May accounts use ed25519

Sure, it's totally possible. This is how moonbeam did to use ECDSA. https://github.com/PureStake/moonbeam/blob/580a3ef92858f5e667176e8156efcd9e2f04d65a/primitives/account/src/lib.rs#L100 https://...
AurevoirXavier's user avatar
  • 10.7k
2 votes

Access to ECDSA sign inside Runtime

yes you can sign some data for your benchmarking code. In sp-io there is the function crypto::ecdsa_sign. You can use crypto::ecdsa_generate to generate you some public/private key to use for signing. ...
bkchr's user avatar
  • 11.6k
2 votes

Is it possible to reverse engineer a private key back into mnemonic?

Nope. Private keys derive from the mnemonic. A mnemonic can generate a lot of private keys. You can also check the HD wallet spec. It's a one-way function like you said. Maybe it's a hash function. ...
AurevoirXavier's user avatar
  • 10.7k
1 vote

Can I use Blake2 128 to store sensitive data?

Encrypt the data before you supply it to the blockchain using a sufficiently strong encryption algorithm. Alternatively you can leave a reference in the blockchain, which is the suggested approach for ...
sea212's user avatar
  • 549
1 vote
Accepted

Web3 Foundation - Accountable light clients via BLS multisignature rollup

I have found the slides from zksummit7: https://drive.google.com/file/d/1BrKuqib5msj_M_kiCorSYWBFvP9VlTCg/view?usp=sharing The slides reference the github repo: https://github.com/w3f/apk-proofs Of ...
TauLepton's user avatar
  • 107
1 vote

Convert any address to accountId (in hex)

There is also the /accounts/{address}/validate endpoint in Sidecar which takes a ss58 or hex (from a u8 array) formatted address and returns the following information : isValid ss58Prefix network ...
dominique's user avatar
  • 1,683

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