Skip to main content

Questions tagged [cryptography]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
32 votes
2 answers
29k views

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 ...
Shawn Tabrizi's user avatar
  • 16.2k
12 votes
2 answers
675 views

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 ...
Oliver Tale-Yazdi's user avatar
7 votes
1 answer
70 views

Accidentally used ETH address to receive token from polkadot

I accidentally used my ETH address to receive token from Polkadot. Is there any way I can access my tokens with my private key? Thanks. For example: https://polkaholic.io/account/...
user avatar
7 votes
1 answer
219 views

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 ...
Ankan's user avatar
  • 335
6 votes
1 answer
523 views

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 ...
h4x3rotab's user avatar
  • 717
6 votes
1 answer
282 views

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?
Yatusabes's user avatar
  • 778
5 votes
2 answers
361 views

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 ...
olanod's user avatar
  • 531
5 votes
1 answer
108 views

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 ...
TauLepton's user avatar
  • 107
3 votes
2 answers
251 views

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(...
kugool's user avatar
  • 171
3 votes
1 answer
220 views

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

Is it possible to reverse engineer a private key back into mnemonic seed if it is not hard derived? Is the private key using subkey derived from the mnemonic in a soft way? if so can the mnemonic be ...
Ramsey - Decentration's user avatar
3 votes
1 answer
175 views

Access to ECDSA sign inside Runtime

Is there any way to access to ECDSA capabilities (like sign) inside the Runtime? I need to create benchmarks where the parameter of one extrinsic needs to be signed using ECDSA. I could create some '...
MigrosLiNX's user avatar
2 votes
3 answers
814 views

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 ...
Nathan's user avatar
  • 454
2 votes
1 answer
85 views

May accounts use ed25519

Is it possible to use ed25519 for account key pairs on a substrate based blockchain instead of the default?
donkeydonkey's user avatar
2 votes
1 answer
73 views

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.
Amiya Behera's user avatar
1 vote
1 answer
92 views

Error: Unable to initialise options more than once

I am using polkadotjs/ui-keyring in which i am trying to use different accounts stores based on user preferences. And i am calling the loadAll to get all the accounts to the keyring, as shown in the ...
Emmanuel Thomas's user avatar
1 vote
1 answer
306 views

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 ...
Morkymork's user avatar
1 vote
1 answer
21 views

Custom hosted functions

We need to verify p256 signatures inside our parachain and after implementation we noticed that it's really slow inside WASM. It appears that one way to speed up this operation is to define a custom ...
Aramik M's user avatar
  • 151
1 vote
2 answers
183 views

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/...
CREESTL's user avatar
  • 484
0 votes
2 answers
72 views

Can I use Blake2 128 to store sensitive data?

I would like to store some sensitive data and because the node would be public I am worried that if can be reserved. What do you suggest to store sensitive data(passwords) in blockchain?
P.E's user avatar
  • 181
0 votes
0 answers
53 views

Cryptographic requirements for random numbers on substrate chain

As far as I know, one of the possibilities to generate random numbers within a substrate chain is by using the pallet_insecure_randomness_collective_flip. However, the documentation explicitly states ...
nhussein11's user avatar
0 votes
1 answer
45 views

How to sign with private key(Not secret key) that was created by "RFC-8032"(described below contents) on offline?

Backgrounds I am working on "ASTAR" parachain scene(TestNet: Shibuya). I can sign message(unsigned-transaction) on offline environment and then broadcast signed-messaged(signed-transaction). ...
JOHNNY JI's user avatar
0 votes
0 answers
16 views

`sp_io::crypto::ed25519_batch_verify` was removed amid Polkadot 0.9.39 and 0.9.43. What is replacement in Runtime?

We useded25519_batch_verify in runtime from sp_io::crypto mod. sp_io::Crypto and Verify traits require self, but I cannot find implementation. In substrate primitives core I see verify calling fn ...
Dzmitry Lahoda's user avatar