Questions tagged [hash]
A hash function is an algorithm that transfers data input of any size into a fixed size data which acts as a kind of "signature" for the data provided.
268 questions
3
votes
0
answers
24
views
Why are there two secrets in the ZKP nullifier construction?
Tornado Cash makes use of ZKP and nullifiers to prevent double spending.
Why is the submitted hash for the Merkle tree is that of concat(nullifier, secret) instead of concat(secret, 0x01) and the ...
0
votes
1
answer
22
views
Get all event hashes for ABI
I have a smart contract ABI. What's the easiest way to compute the keccak256 hashes for the events in the contract?
0
votes
1
answer
36
views
ethers hashMessage and solidity keccak256
Hi guys i try to hash message in my app like this
const hash = ethers.hashMessage(msg+'-'+salt)
then verify hash in smart contract like this
bytes32 c = keccak256(abi.encodePacked(msg,"-&...
0
votes
1
answer
12
views
Will Chain link price changes will affect hash value?
If I fetched the current USD price from Chainlink, deployed my contract, and new blocks were mined after that, what happens if the USD price changes? Will the hash of the contract or the blocks after ...
0
votes
3
answers
98
views
What's the best practice to storing encoded data on-chain?
I need to store some encoded data on-chain that I can then decode to obtain the original data. The idea is that this data comes in the form of a JSON.
Is it possible to do this? Must fields in the ...
0
votes
1
answer
53
views
What Post-Quantum Secure Hash Functions Are Available for Usage in Solidity Smart Contracts?
Question:
I am developing Solidity smart contracts and am concerned about the future security of cryptographic hash functions in the face of quantum computing advancements. Specifically, I am looking ...
1
vote
1
answer
100
views
Is the sum of hashes cryptographically secure for a set of addresses?
In a smart contract, I want to maintain a set of addresses independent of the order. Would the sum of the hashes for each of the addresses be a cryptographically secure approach?
If I do:
root = ...
0
votes
0
answers
12
views
DNS using blockchain (how can i hashed my domain name ) in the code below help me to complete this code
import Web3 from "web3";
import Registry from "./contracts/Registry.json";
import Resolver from "./contracts/Resolver.json";
import Cache from "./contracts/Cache....
1
vote
1
answer
36
views
How to get the hash of the Fulfill Random Words transaction (callback) that gets mined after calling the Chainlink's VRF?
I have the hash of the transaction that called Chainlink's VRF but I need to get the hash of the callback transaction that gets executed after the RandomWordsRequested event is fulfilled.
How do I do ...
1
vote
0
answers
39
views
how get last 10 transaction hash for a address (kotlin)
i want to get last 10 transaction hash of a wallet address.
i use block numbers but it's return block number is too wide !
the block number is limited and every hrs is under update....
if anyone know ...
0
votes
1
answer
134
views
How is signing a hash different from signing a message?
I've got an Arduino microcontroller (ATmega328P) where I can use the following code (borrowed from here) snippet to sign an arbitrary message . First, I take the keccak256 hash of the message, and ...
0
votes
1
answer
93
views
Can I find the hash using a partial hash address in order to look it up at etherscan.io?
For example 0x0DDF2…e7D19
How can I find/search for the reminder the address?
The auto complete feature is no longer available at etherscan.io
0
votes
2
answers
44
views
Hashes don't seem to match even though created with the same params
I have a function in Solidity that is supposed to check if the recovery hash committed by the Email recovery service matches the hash generated through the token and nonce sent by the user (He ...
1
vote
1
answer
495
views
How can I create a message hash in Solidity that matches Viem?
I'm creating a message hash with Viem in typescript and in Solidity, however, I can't seem to get the hash in Solidity to match the one created with Viem.
My viem code:
const hashedMessage = ...
2
votes
1
answer
193
views
How are Ethereum 2 block hashes computed?
After the merge, the block hash computation has a different formula. Before that, the following data were used to compute the hash via feeding the list of hex values to an RLP encoder and hashing the ...
1
vote
0
answers
13
views
What's difference between filter for hashes and filter for full transactions?
I'am trying to understand the main difference between a filter for hashes and a filter for full transactions. Can anyone explain me this please?
0
votes
1
answer
47
views
To what extent was the block hash malleable under proof-of-work?
To emphasise, I’m solely interested in blocks prior to the transition to PoS.
Given that a miner making any change to the block header would have resulted in a completely different hash, my thinking ...
2
votes
1
answer
78
views
Generating a NFT token
Let's say we are generating an NFT token for a picture. How is the token generated? Is it just the hash value (say SHA256) of the picture? Is it possible to find a collision? If so, how is the ...
2
votes
1
answer
1k
views
How to Resolve "ambiguous primary types or unused types" Error with _TypedDataEncoder.hash?
I am trying to compute the hash to be signed for EIP-712 typed data using the ethers.js(v5.7.2) library in TypeScript. I'm using _TypedDataEncoder.hash() to hash the typed data, but I am encountering ...
0
votes
1
answer
412
views
How to rebuild ethereum block hash using Solidity/JavaScript [duplicate]
Can someone point me to a good resource to see how a BLOCK HASH is being built by hashing the BLOCK HEADER fields (which fields and how to process/encode them - keccak/rlp)?
My main goal is to get the ...
1
vote
0
answers
24
views
How to manually hash blocks and transactions to get a better feel for the Ethereum protocol?
Is there a way to easily get a transaction, the full transaction payload, and then hash it with keccak256 using a hash tool, to get a better feel for how the protocol works?
Ditto for full blocks.
I ...
0
votes
1
answer
1k
views
How to calculate a pair address given token addresses
How do you combine two token addresses to form a pair address?
I would imagine this is purely mathematical and doesn't require a call to web3. I want to know how to do it without calling the internet....
0
votes
1
answer
840
views
"invalid signature length" when trying to verify signature
I'm using the entire source code to sign and verify messages from https://solidity-by-example.org/signature/ on Remix. But when I go through the process of running the functions getMessageHash, ...
2
votes
0
answers
43
views
Calculating difficulty and target with 256 bits
Why do the yellow paper and Ethereum implementations use 2**256 instead of 2**256 - 1 when calculating hash target from difficulty?
The Ethereum Yellow Paper uses 2**256 / difficulty to define the ...
0
votes
1
answer
120
views
How to get the subgraph hash once compiled and deployed using graph-cli?
I have a graph-node running in a EC2 instance. The subgraph has been compiled, created and deployed already and it is running with no issues.
I want to query its status by running the following ...
7
votes
4
answers
2k
views
Verifying signed messages on chain
I have the following message, domain and types:
const domain = {
// Defining the chain aka Goerli testnet or Ethereum Main Net
chainId: NETWORK_ID,
// User friendly name to the ...
2
votes
0
answers
53
views
Hash metamask message
I have the following metamask message (type v4):
const message = {
domain: domain,
// Defining the message signing data content.
message: {
Commit: {
...
0
votes
1
answer
311
views
Does a TX hash get produced *before* it's been confirmed in 1 block?
I has code which sends ETH and ERC-20 and of which I want to make sense:
let tx1 = await transferETH(amount, privateKey);
console.log(`${tx1.hash}`);
const receipt1 = await tx1.wait();
console.log(`...
0
votes
1
answer
46
views
Hash an array of variables and reverse hash them off chain
I'm trying to accomplish a task but I'm not sure how to approach the problem. I want to hash some variables inside a byte32 array. For example:
["Hashley", 32, "Random string"] -&...
3
votes
1
answer
340
views
calldata ambiguity - likelihood of hash collision
To call a function in a smart contract, a transaction (or a message call depending on where it originates from) is sent to the contract address with a data field that has the encoded function ...
0
votes
2
answers
522
views
How to generate the correct hash for signatures?
I want to create a hash in JavaScript for a signature.
The hash needs to have the same output as this in solidity:
keccak256(abi.encodePacked(address, bytes32))
My solution in JavaScript so far ...
1
vote
1
answer
132
views
"Reverse ENS lookup" using php-keccak
I am using kornrunner/php-keccak and I am attempting to do a "reverse lookup" on an ENS name, essentially the same as this question which was never answered. Any thoughts?
Here's my attempt ...
0
votes
1
answer
48
views
Is there a way to change the block hashing method of private Etherem?
As all we know, Ethereum hashes blocks by Keccak-256 and this method used in private Ethereum too. Now, if we need to use Keccak-512 for hashing blocks in a PoA private Ethereum (For our project), ...
1
vote
1
answer
270
views
Why blockhash returns zero always? [duplicate]
I have a problem with understanding. I created a utility function, safeMath() , which I run first to create the block. Next, I get the block number, which is usually in the range from 10 to 14. And ...
0
votes
1
answer
126
views
How is calculated the "lowest hash value" in Proof-of-stake random block selection?
https://www.geeksforgeeks.org/proof-of-stake-pos-in-blockchain/
Dont know how you can get the "lowest hash value". Hash value in PoW I can understand, is it related? How does it work in PoS?
0
votes
1
answer
416
views
How do I predict my transaction hash before putting through a transaction?
I'm trying to figure out how to get the transaction hash for some transactions. I don't have the hashes in my data; all I have is approximate time (to the minute), size, and token. I think I can get ...
0
votes
2
answers
2k
views
Ethers: Get transaction hash without sending transaction
My transaction fails, so it doesn't give me a hash that I would be able to use to debug it when I call ethers.wallet.sendTransaction(tx). The tx object has 4 fields: from, to, data, value. If I do
...
1
vote
0
answers
77
views
Computing a 512 bit hash
Ethers.js has this 512 bit hash function ethers.utils.sha512, but as far as I can tell there is no OPCODE or precompiled contract for doing this. There seems to be some implementations in solidity ...
1
vote
0
answers
32
views
Explorers have not mixhash [closed]
Why do ethereums explorer (like blockchain.com or etherscan.io) , have not mixhash in block information? Only Nonce. And why nonce in block explorer on blockchain.com is always 0?
2
votes
1
answer
62
views
What information can I get from a hash?
Say i have a hash - I think sha256/keccak:
90ad6dec4ce7167e92c7a7122232d48a1fd5e6c5e81cb3f45c147424b6728437
What do i do with it?
Is there something on etherscan that can decipher it or show what it ...
2
votes
1
answer
101
views
Question about the namehash algorithm in EIP-137
I am trying to recreate the namehash algorithm from EIP-137.
After spending a lot of time trying to create my own algorithm, I tried to find a working python3 package online and couldn't find any.
I ...
3
votes
2
answers
461
views
if I put a message's sha256() hash on smart contract, can anyone recoverd the message?
If no one can recover the message, can I use this message as a "password" to some functions in the smart contract? like:
contract Test {
bytes32 hash;
constructor(bytes32 _hash) {
...
0
votes
1
answer
257
views
How to decode and update input data of a specific transaction?
So, I've decoded the input-data and fetched it via block-hash, Now what I want to do is that, I want to update the input data and post that updated input data back to the same transaction of the same ...
1
vote
0
answers
27
views
How is the the net probability mentioned in EIP-55 calculated?
In EIP-55, it says:
the net probability that a randomly generated address if mistyped will accidentally pass a check is 0.0247%
I am curious about how this probability is calculated and tried to ...
0
votes
1
answer
233
views
Sha256 Hash from Solidity Smart Contract doesn't match web3.js Hash
I'm struggling to match two hashes. I hash a Json in String format in my Smart Contract like this.
function verifyProof(string calldata _fullProof) public returns(bool r){
bytes32 hashed = ...
0
votes
1
answer
195
views
Signature from array of tokenId's isn't verifying
The domain message is:
struct Offer{
address from;
address to;
uint256 nonce;
uint256[] tokenIds;
uint256 duration;
}
bytes32 constant ...
0
votes
1
answer
88
views
How are we able to verify signatures using the public key?
I get that:
private key --ECDSA--> public key
private key + message --ECDSA-->signature
But then how do we verify the signature with the public key?
Wouldn't we have to reverse-ECDSA the public ...
0
votes
1
answer
276
views
How to determine if the hash is finalized?
For some reason, I am require to store the hash to database. I would like to know is there any criteria to determine that the hash is finalize?
For example,
Block #15000000 have hash value of
...
0
votes
1
answer
1k
views
What is the difference between "hash" and "block hash" as is demonstrated in the data?
In the following data, there are two kinds of hashes. One is a "hash" variable and the other is a "block hash". While I sense that the latter should be the block header hash, I do ...
1
vote
1
answer
639
views
Solidity Keccak256 raw data vs abi encoded data
I am new to solidity. I am trying to store some hash of the data to the blockchain. I saw some online tutorial used keccak256(abi.encodePacked( <data input> )) to calculate the hash. I am ...