Questions tagged [hash]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
56 views

Democracy proposal not enacted

First of all I am working on Polkadot-v0.9.29. I am struggling to understand the right way to format a pallet call before submitting it as a proposal to the democracy pallet. Let's the pallet call be ...
1 vote
1 answer
71 views

H256 to_string() function does not return complete string

I have a H256 value which is an extrinsic returned hash 0x8d19a2e575d583b8812418c71be304f16a978cfac2bfad54afcad824cb4d3471 but when i convert this to String using .to_string() it does not return ...
1 vote
1 answer
42 views

How to use keccak256 sha256 in ink smart contracts?

I want to hash string using sha256 and then store it inside of my ink smart contract. I tested this code in Rust and it works out for me: use crypto::sha2::Sha256; use crypto::digest::Digest; let ...
  • 11
1 vote
1 answer
207 views

Convert a H256 string to H256

I have a hash string "0xf8dd02cc2a3174933fac4e87d7f6360c3cc67167db105b28d0bc434a60674e49". How can i convert back to H256. I used function below but it return difference H256 ...
0 votes
1 answer
39 views

What is the best practice for storing a hash?

I am about to make the decision on how to store some hash value inside the blockchain. A hash value is the best practice to minimise the size of the blockchain, but still allows people to verify ...
  • 157
2 votes
1 answer
43 views

`sp_core::hash::H256::random()` not found

Trying to generate random 256 bytes hash-like data. But compiler tells error[E0599]: no function or associated item named `random` found for struct `H256` in the current scope --> /home/poh/...
2 votes
2 answers
81 views

StorageHasher: Blake2 vs Twox

When creating a StorageMap, a hashing algorithm needs to be chosen for the StorageHasher. frame_support provides a few options: Identity Blake2_128 Blake2_128Concat Blake2_256 Twox64Concat Twox128 ...
0 votes
1 answer
74 views

What is the best way to find the genesis hash for a chain?

My understanding is the following terms which are used in different contexts and applications all refer to the same thing: "genesis hash", "network key", "chain id". I ...
  • 283
1 vote
1 answer
49 views

ink_env::ecdsa_recover is not returning the right public key

I am having an issue trying to verify ecdsa signature in ink! for my test. I am generating the signature this way const keyring = new Keyring({type: 'ecdsa'}); const pair = keyring.addFromUri('//...
  • 177
3 votes
1 answer
54 views

Can't get transaction hash from signAndSend of Polkadot.js

I'm new and I'm trying to get the transaction hash but I'm only getting undefined. I used this tutorial and this and below is my code. const txHash = await polkadot.tx.balances .transfer('5F1pZe........
0 votes
1 answer
27 views

Hash for an authorize-enact runtime upgrade?

Attempting a parachain runtime upgrade using .runtimes.compact.subwasm.parachain_authorize_upgrade_hash and .runtimes.compact.wasm from the srtool-cli@v0.8.0 output. Enacting the runtime upgrade ends ...
6 votes
2 answers
330 views

Why could we find the same transaction hash in 3 different blocks?

We found that this transaction 0xf35238b1ef440e2a04576c8264ca8288100091a3d4c71069f0336c72078f366b was included into the following three different blocks : 10219793 10219254 10218427 Could you ...
  • 1,148
2 votes
1 answer
85 views

How to obtain the transaction hash of each transaction

Getblock through RPC method. I can only see the block hash. But I want a hash for each transaction. What should I do?
  • 63
0 votes
1 answer
39 views

Is there anyway to receive a transaction hash from a transaction that was signed by the keyring?

I am creating an application and signing an extrinsic with a keypair using the keyring. I was wondering if I can receive the transaction hash somehow after it has been signed
6 votes
1 answer
92 views

Generating a Storage Key when making an RPC request

I'm trying to make an RPC call to a Substrate node, but I can't generate a proper Storage Key. The Module and Method parts are fine, the problem is the Twox64Concat part. The sp_core::twox_64 of value ...
5 votes
3 answers
123 views

How to convert Public key (hex) to SS58 Address in JavaScript / Polkadot-JS?

I have a Public key (hex) and would like to convert it to an SS58 Address. What is the right function to use? I found the docs here with an code-sniped: https://substrate-developer-hub.github.io/docs/...
  • 71
5 votes
1 answer
35 views

How to create XOR Hashes in Substrate

Say you have two account ids Aid(A) and Aid(B) and you want to combine them.e.g. XOR( Aid(A), Aid(B) ). Basically, I want to achieve this; T::Hashing::hash_of(&(idA, idB)) == T::Hashing::hash_of(&...
  • 649