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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
11 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 ...
user avatar
0 votes
0 answers
15 views

How determine is the hash 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 ...
user avatar
  • 101
0 votes
0 answers
6 views

What value does brownie hash for an empty contract?

I am trying to pinpoint what exactly is getting hashed when deploying a contract with no functions or any explicitly defined constructor. My contract is Hash.sol: pragma solidity ^0.8.0; contract ...
user avatar
0 votes
1 answer
19 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 ...
user avatar
0 votes
0 answers
14 views

Force .send() to return early transaction hash instead of waiting for receipt

let txResult = await myContract.methods .myContractFunction(addressInputParam, amountInputParam) .send({ from: owner, gas: 200000 }) .on("transactionHash", function (hash) { const ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
1 vote
1 answer
24 views

In Polygon transaction ID of Sync-State transactions does not match Keccak-256(RLP(nonce,gasPrice,gasLimit,to,value,data,v,r,s)

Polygon has special “Sync-State” transactions added to the blocks https://polygonscan.com/address/0x0000000000000000000000000000000000000000 . Transaction hash returned by eth_getBlockByNumber does ...
user avatar
  • 121
0 votes
1 answer
25 views

How much ether was transferred in this transaction?

Is there any way to determine how much ether was transferred in the following transaction? If so, how much was it? Transaction of interest { "hash": "...
user avatar
  • 189
0 votes
1 answer
18 views

when i call my function metamask telling "this operation is expected to fail"

Hi guys im trying to create question challenge dapp and i have a checkAnswer() function can accessable from frontend. My question struct: struct Question{ string qDesc; uint qPrize;...
user avatar
0 votes
1 answer
111 views

How to hash an address?

I just want to hash the senders' address function myHash() public returns(string memory){ return(keccak256(abi.encodePacked(msg.sender))); } but no matter what I do I get the ...
user avatar
  • 1
1 vote
1 answer
26 views

Hash two addresses in vyper

I'm trying to write a function in vyper that takes two addresses and returns a 256-bit hash (either keccak256 or sha256). Afaik the builtin hash functions only take Bytes, bytes32 and Strings as ...
user avatar
  • 113
0 votes
0 answers
26 views

how to calculate root hash in MPT?

I already know how to build an MPT, but don't know how to compute root hash, especially how to deal with the leaf nodes. I would be grateful for specific examples.
user avatar
5 votes
2 answers
2k views

How to use ethers keccak256?

I tried to use ethers' keccak256 function like this: import { keccak256 } from "@ethersproject/keccak256"; const signature = keccak256("balanceOf(address)"); But the script ...
user avatar
0 votes
2 answers
382 views

What exactly is the output of a keccak256() function?

I've been looking through articles and youtube videos and I still don't get it. I'm trying to get to a place where I can explain it to myself in simple terms (I'm still pretty new to coding). What I ...
user avatar
1 vote
1 answer
66 views

Can you get a duplicate hash with params that are NOT a string or array, using keccak256(abi.encodePacked(a, b))?

It's relatively common to confirm a msg.sender is pre-approved for some contract interaction by verifying a signed hash of their address and another parameter. For instance: bytes32 checkHsh = ...
user avatar
  • 69
0 votes
0 answers
34 views

CryptoZombies - Confused on how exactly using "randomNum % 10^16" shortens randomNum to 16 digits?

In the second to last line, I can see that the input argument is being hashed into a random 256-bit hexadecimal number. Then in the last line, it takes the random number and uses " % dnaModulus&...
user avatar
1 vote
1 answer
184 views

Provable way to whitelist a contract before it is deployed?

I would like to prove that a contract, that is going to be deployed, matches specific code and potentially with a specific state too. For example, Bob say's he is going to deploy a contract that looks ...
user avatar
0 votes
0 answers
30 views

what is a Maker Order Hash?

I was going through Looksrare's contracts and found this - bytes32 internal constant MAKER_ORDER_HASH = 0x40261ade532fa1d2c7293df30aaadb9b3c616fae525a0b56d3d411c841a85028; struct MakerOrder { ...
user avatar
  • 21
0 votes
0 answers
72 views

Creating a raw transaction hash

How can I create a simple raw transaction (Without signing and signature) and get its hash key in python?
user avatar
  • 1
0 votes
0 answers
73 views

Patricia Merkle trie and LevelDB in each block

I have a few questions regarding Ethereum's modified Patricia Merkle trie and LevelDB. Does each block only contain the root hash of all the tries (World State, transaction, and receipt) or the ...
user avatar
  • 587
0 votes
0 answers
56 views

How can I get the parent block using etherscan API?

I want to get the chain of blocks using etherscan API. I can get any block by its number (eth_getBlockByNumber). I can get the latest block number as well (eth_blockNumber). If I have the parent block ...
user avatar
0 votes
1 answer
174 views

What is the return of uint(keccak256(_str));?

I'm doing the chapter 1 of the crypto zombies course. uint id = zombies.push(Zombie(_name, _dna)) - 1; NewZombie(id, _name, _dna); } function _generateRandomDna(string _str) ...
user avatar
  • 13
0 votes
1 answer
28 views

Why does mining difficulty, gas prices raise, yet some transactions still fail?

I would be grateful if someone was able to clarify this, given my assumptions: Mining difficulty is depending on the amount of computational power invested into verifying transactions on the ...
user avatar
0 votes
0 answers
164 views

How to pass a bytes32 hash to a contract

I am working with the contract deployed to Mumbai here. You'll see a few transaction errors from me trying to run the below code (using Alchemy). I am trying to hash the input startupName locally so ...
user avatar
0 votes
0 answers
54 views

How to get order hash?

I have an order in the form of a js object: let order = { chainId: '56', exchangeAddress: '0x', makerAddress: wallet, takerAddress: '0x0000000000000000000000000000000000000000', ...
user avatar
3 votes
2 answers
172 views

How do you prove ownership of a digital asset with NFTs?

I have a few questions regarding NFTs. Every source I find online roughly says that an NFT is a blockchain-stored ownership certificate for a certain digital asset. But I don't understand how that ...
user avatar
1 vote
0 answers
354 views

How do I perform _hashTypedDataV4 on a struct containing an array of structs

I have signed a typed data, and I am trying to recover the address of the signer from my contract using ECDSA.recover(). But each time I try it, I get an address that is different from the address of ...
user avatar
  • 131
0 votes
0 answers
89 views

Is it theoretically possible to remove the receipt root hash in the Ethereum block header?

I was just wondering if Ethereum would still work without a receipt root hash? Is it theoretically possible?
user avatar
1 vote
1 answer
363 views

Why is value of ECDSA v often neither 27 nor 28?

There are a lot of information out there explaining that in the ECDSA signature the value of v is always either 27 or 28. However there are many transactions which, when decoded using several decoders,...
user avatar
0 votes
1 answer
395 views

Try to mint from a contract but the hash is missing

function mint(bytes32 hash) external { require(!_hasMinted[msg.sender]); require(totalSupply() + premineRemaining < 500); require(hash == sha256(abi.encodePacked(msg.sender, ...
user avatar
0 votes
0 answers
15 views

Dynamic values in signatures

I followed this tutorial about signatures https://forum.openzeppelin.com/t/sign-it-like-you-mean-it-creating-and-verifying-ethereum-signatures/697 At first, I managed to replicate and test, but ...
user avatar
  • 121
0 votes
0 answers
17 views

How exactly is the unique Transaction hash ID generated? [duplicate]

The reason I am asking is because I want to know if it's possible to guess / manipulate the next transaction hash ID on the chain.
user avatar
0 votes
0 answers
35 views

Examples of checksum/hash used to establish ownership

Are there any examples of one-way hashes or checksums being used in a legal context to establish ownership, creation, or prior art?
user avatar
  • 101
0 votes
1 answer
164 views

How can I manually calculate a transaction hash of a transaction JSON object

So I have a transaction. I have a transaction that I would like to manually calculate the hash: { "hash": "0xf4584008cc70f2f532765a2f035a2525992a258b2d2afd6b49ad5b2857a6197d", &...
user avatar
2 votes
0 answers
35 views

How to check if ETH transaction was ever sent

I'm creating a transaction with web3.eth.accounts.signTransaction. I'm then storing that transaction hash, then sending it over the ETH network with web3.eth.sendSignedTransaction How do I ...
user avatar
1 vote
0 answers
15 views

Understanding Hash Lock Atomic Swaps

I have trouble understanding how exactly atomic swaps take place in HTLCs. Let's take the generic example: Alice wants to trade 1 BTC with Bob in exchange for 15 ETH. Alice creates a contract where ...
user avatar
0 votes
0 answers
11 views

Can I get the hash of any past block using Solidity? [duplicate]

Is there a limit of blocks ago that I can get the hash of within solidity using block.blockhash()?
user avatar
  • 878
2 votes
2 answers
1k views

Why some ERC20 tokens have different Transfer event ABI signature than Transfer(address,address,uint256)?

Looking at ChainLink ABI (using this tool) I see { "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": &...
user avatar
  • 31
1 vote
1 answer
156 views

How to know if a transaction gets dropped and txhash becomes irrelevant before its mined

I am using a web3 sendTransaction function to send coins, and then storing the transactionHash in my databse await web3SendInstance.eth.sendTransaction({to:receiveAddress, from:web3.eth.defaultAccount,...
user avatar
1 vote
0 answers
58 views

Is using blockhash a good source of randomness on PoS blockchains with a lot of blocks mined in a short period of time?

I am trying to make a casino-like game using a smart contract and employing only on-chain data. I understand that on a blockchain like Ethereum a malicious miner can cheat the system by withholding ...
user avatar
0 votes
2 answers
2k views

Code example: How to get transaction hash before sending transaction

I know their might be examples online, but they do not really solve my issue. So let us say I have the code below: this.factoryContract = new ethers.Contract( "factoryContractAddress", ...
user avatar
  • 1,343
1 vote
0 answers
103 views

How to prevent front-running the salt when using CREATE2?

I was looking at Optionality's clone-factory, which is based off EIP-1167, and wondering whether it can be ported to use CREATE2. One concern is that a third-party could, in theory, "front-run&...
user avatar
2 votes
0 answers
205 views

Signing a hash with EIP712

Is it possible to sign just a hash with the EIP712 standard (either within Solidity or Ethers.js)? If so, how? All that I'm finding online is the full EIP712 process of domain, types, values, signing ...
user avatar
  • 307
0 votes
1 answer
21 views

Hashing an input

I'm writing a protocol that requires users to not be able to see previous input. Is it possible to hash a users input and send the parameter as the hashed version of the input?
user avatar
  • 87
0 votes
1 answer
44 views

Two buy orders at the same exact time, no miner tips included, but lower GWEI order wins. How is this possible?

question for the group: if two buyers submit a Buy at the exact same time, one chooses 300 gwei and the other chooses 400gwei, no Miner tips on either one, is there some scenario where the 300gwei one ...
user avatar
0 votes
0 answers
59 views

Index and Search Archive node database for method hash

I want to find similar method hashes, either from contract bytecode or transaction hashes (which in theory are the same because the contract bytecode comes from a contract creation transaction) I have ...
user avatar
  • 147
0 votes
0 answers
11 views

Examples or standard methods on carrying out numerical tests on hashed values by keccak256

I am wondering if items described in the title can be found anywhere like in published literatures, forum discussions, or academic research papers. Thanks.
user avatar
  • 439
0 votes
1 answer
142 views

How exactly was the small pics inside the Beeple NFT cryptographically hashed along with the consolidated big one?

I understand that the Beeple pic consists of very small circles each lead to a pic drawn by the same artist, ie it's uniqueness or high price came from the fact that it is like a consolidation of all ...
user avatar
  • 1
2 votes
0 answers
45 views

Dataset for efficient data retrieval

I am currently struggling to design a Solidity-based data structure that is meant to store bits of information indexed by a 10-character base32-encoded key (i.e. geohashes). Trick is, that I will need ...
user avatar
  • 150
1 vote
0 answers
218 views

Ethereum Keystore Hashcat

I have a keystore file but I can't remember all the passwords. Then I use Hashcat and I try to crack it with my list of words that I made but I don't know if I use the correct commands. hashcat.exe -...
user avatar

1
2 3 4 5