Questions tagged [cryptography]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers

Why are sr25519 signatures non-deterministic?

According to the polkadot.js docs, both ed25519 and ecdsa signatures are deterministic (given the message and private key, it always produces the same signature). However sr25519 is not. I understand ...
  • 566
1 vote
2 answers

verify a signature in pallet

I followed the answer of "how to verify a signature in a pallet", and try to verify some data signed by a private key on chain logic. #[pallet::weight(10_000)] pub fn my_verify(...
  • 71
1 vote
1 answer

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

What are the (high-level) steps to, firstly, create a substrate address from a private key and secondly, to create a m-of-n multisig address? A description similar to this image would be just about my ...
2 votes
3 answers

Convert any address to accountId (in hex)

How can i convert an address of the form "5DTNtGF2DmZ7QwGxg6n1xWzF6cEokNyNre7mUqpVuozrLxu3" to hex using polkadotjs packages? Here is the context: I have multiples array of datas, containing ...
  • 374
1 vote
2 answers

Problems With `app_crypto!` Macro

I have the following error while building: error[E0599]: no function or associated item named `generate_with_phrase` found for struct `crain_pow::app::Pair` in the current scope --> node/src/...
  • 414
5 votes
1 answer

Web3 Foundation - Accountable light clients via BLS multisignature rollup

I listened to a talk at zksummit7 titled "Web3 Foundation Accountable light clients via BLS multisignature rollup" given by Alistair from web3f. My interpretation of the talk is that ...
4 votes
1 answer

How does Substrate detect the signing scheme when verifying signatures?

Substrate supports multiple signature schemes: ecdsa, sr2551, ed25519. When sending a signed transaction how does substrate know what scheme to use for signature verification?
  • 431
6 votes
1 answer

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

I am trying to write a discord bot using rust/serenity to verify signature signed using polkadot.js app. I use schnorrkel crate, wrap the message in <Bytes>...</Bytes> and use the verify ...
  • 105
2 votes
1 answer

zk SNARKs based anonymous voting [closed]

I want to implement zk-SNARKs based anonymous voting. Are there examples or packages available for substrate? Where can I get started.
12 votes
2 answers

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

We have seen evidence that users can sign messages using the SR25519 and ED25519 public key with all zeros. Why or how is the private key to this public key known? Are there any other things users ...
  • 12.3k
2 votes
1 answer

Convert Ed25519 signature/pub-key to sr25519

Working on libwallet we'd like to create a back-end for Rust friendly micro-controllers for possible future Substrate friendly hardware wallets. The nRF52 and other chips are very common in the ...
  • 441
9 votes
2 answers

How to verify a signature in a Pallet?

I have a Pallet that should verify a signature for some input data and a specific public key. It looks like this: fn verify(_: OriginFor<T>, data: Vec<u8>, sig: ???, from: ???) Is this ...