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
0
votes
1
answer
835
views
Can a transaction hash be used to identify the sender of a payment?
A user suggested using a transaction hash as a way to track user deposits (especially for ECR20 tokens):
The major issue arises when you start accepting erc-20 tokens as
payment, in that case when ...
0
votes
1
answer
1k
views
Keccak256 hash different in solidity and web3js
I am trying to sign a message in NodeJS and verify the signature with smart contract. Here is my code:
async function prepareAndSignMessage(to, amount, referenceTransaction){
let contractInstance =...
0
votes
0
answers
31
views
When is the transaction mined?
I'm working on an ethereum blockchain project where people want to make reservations in a city. My backend sends a transaction to the smart contract with the user id, city and other data. The smart ...
0
votes
1
answer
976
views
Best way to record document hash and address (mapping vs transaction input data)
First of all, sorry if the question is too open, is not a coding problem but a design decision.
I'm doing a bit of research about storing a proof of a document existence (a hash of the document) in ...
0
votes
1
answer
87
views
How to verify that a smart contract was deployed by us?
I would like a method called from Solidity to either
verify the hash of an entire smart contract's code, or
read some immutable EVM property that contracts expose that say who deployed them, e.g. a ...
0
votes
1
answer
366
views
A good way to decode transaction hash content on public Ethereum blockchain?
I want to check if there are some good tools available to decode the transaction hash to know the content on public Ethereum Blockchain? Primarily to validate the data stored by the dapp.
Thanks
3
votes
1
answer
2k
views
How to get the type of transaction (Send/Receive/Approve/Swap) and the ERC20 tokens involved in that transaction?
I', getting to know the Ethereum technology (so rookie level). By far, with the free APIs (etherscan.io, ethplorer.io, coingecko) I have been able to build a "watch wallet". It looks like ...
0
votes
1
answer
48
views
Cryptographic hash of the entire Ethereum database
I need a cryptographic hash of the entire Ethereum database (of the information in all blocks up to a certain block number). Is there a service that calculates this hash?
0
votes
2
answers
1k
views
How to get transaction hash without waiting for await call?
for my demo I need the transaction hash instantly without waiting for callback of sync call.
Here my code:
aggiungiAllaBlockChain: async(u,n,c,e) => {
try {
const web3 = new Web3(App....
2
votes
2
answers
951
views
EcRecover signed message does not match PublicAddress
I am trying to create a C# webservice back end API that handles the code logic found in Step #5 here:
https://www.toptal.com/ethereum/one-click-login-flows-a-metamask-tutorial
Their code looks like ...
2
votes
0
answers
1k
views
web3.utils.sha3 and web3.sha3 are not returning same hash
I am referring to example given in link. I will summarize the steps given in the example to save your time from reading.
The example used below smart contract to demonstrate the web3.eth.getStorageAt()...
0
votes
1
answer
1k
views
What is difference between "network hash rate" and "individual hash rate"
suppose for example if nonce is 32 bit then the total possibility of hashing attempts is 2^32 ( 4,294,967,296 ) times only, but why it is mentioned in every article as PH/s or EH/s (1,000,000,000,000,...
3
votes
1
answer
51
views
Transaction hash on a degree certifiate
About a week ago I completed an online course from a reputed university. When I got the certificate, at the bottom I noticed a 'Blockchain Hash' followed by a long string of characters. When I clicked ...
5
votes
0
answers
285
views
how to calculate the message part for pedersen hash in solidity
I am trying to implement pedersen hash using solidity. Is it possible to implement and how to split the message according to the conditions of pedersen hash.
0
votes
0
answers
322
views
Passing a hash value to function
I'm trying to authenticate users by comparing the hashes created by backend server and contract. Seems like "byte32" values cannot be coerced into strings. So, instead I'm converting it into ...
0
votes
1
answer
1k
views
I have a Transaction Hash, how to get the readable Input Data?
i have a Transaction Hash:
0x9f46760404dd3075533e8360fe4beb0ba7210423af1f4a95a5c80defffe824b5, for
how do i decode the "input data" easily?
for example:
https://www.blockchain.com/eth/tx/...
1
vote
1
answer
361
views
Is a Hash Function really useful in a Smart Contract Election?
Noob here. Was reading this: https://karl.tech/learning-solidity-part-2-voting/
From my basic understanding, a hash function:
Receives an input (like x) and spits some result (like y)
y is ...
0
votes
1
answer
7k
views
web3 eth return returns a nonexistent transaction hash
I'm trying to create transactions something like this:
var sender = meth.eth.accounts.privateKeyToAccount(data.fromPrivate)
meth.sendTransaction({
sender,
to: data.to,
amount: data.value,
}, cb)
...
0
votes
2
answers
180
views
Data validation using Ethereum
I'm pretty new to the BC and specifically Ethereum world and I'm just starting to scratch the surface of the potential applications of this powerful technology.
As I'm approaching to build my first ...
0
votes
1
answer
114
views
Mapping didn't storing unique values
I wrote this piece of code with the goal to store unique documents hash. Used mapping to accomplished that.
pragma solidity ^0.5.16;
contract DocumentHash{
string public documentHash;
...
0
votes
1
answer
601
views
Blockhash Minus-256 Problem [duplicate]
What is meant by Blockhash Minus-256 Problem?
I am reading an article at:
Bad Randomness
It talks about Blockhash Minus-256 problem but does not explain much about it. As a result I can’t ...
1
vote
1
answer
896
views
Blockhash: Register the block number
I am reading the following article from a website:
bad randomness
In the context of Blockhash the author says:
For instance, a good protocol (formulating a random trial as a “bet”)
is the following:
...
6
votes
3
answers
2k
views
What is meant by on-chain randomness? What is the difference between on-chain and off-chain operations in the context of randomness?
I want to understand on-chain and off-chain operations in the context of randomness. Kindly provide me an example so that its clear to me.
I got one post here:
What are offchain and onchain ...
1
vote
1
answer
182
views
transfer hash verification on contract side
I want to verify if message-hash has a particular contract method.
Like below web3 code generates a rawTransaction having,messageHash,v, r, s, rawTransaction
let rawTransaction = {
'from': ...
4
votes
0
answers
244
views
Advantage of Chainlink's VRF over commitment scheme chain
News
Chainlink announced a randomness oracle via VRF: https://blog.chain.link/verifiable-random-functions-vrf-random-number-generation-rng-feature/.
Question
What is the advantage of an VRF over a ...
0
votes
0
answers
216
views
Geth returns tx hash but blockchain
I have a Geth server on light mode, and implemented sending transactions based on web3.php project. Everything works well, except sending transactions.
The code I am using sends from, to, and value ...
0
votes
1
answer
683
views
web3.eth.getBlock isn't triggered
Basically, i want get the callback result of first method to get each index value in pass it to the second method to scan this value, in this case is an ethereum transaction to get the input value. ...
1
vote
1
answer
482
views
Sha256 and abi.encode of number
If I calculate the following in Solidity 0.6.3:
bytes memory secretSalt = "abc";
hashedSecret = sha256(abi.encodePacked(secretSalt))
I get the result "...
0
votes
1
answer
110
views
Is there any other signature mechanism like ECDSA to verify the signed message if its tampered or not?
I would like to know if there are other signature verification methods other than ECDSA, to verify the message (eg., string, number) signed by a signer.
Actually if there are alternative algorithms ...
0
votes
0
answers
89
views
Geth returns txhash of sendTransaction() but nothing is broadcasted on Ethereum blockchain
I have a strange issue with Geth. The code I've written is based on web3.php and worked well up to now. Currently, I'm testing sending ETH via sendTransaction() method. The operation finishs and I ...
1
vote
1
answer
308
views
How can I convert an element of a byte32 array to number?
The array contains an SHA256 hash. I want to add up 2 hexadecimal values, and later multiply them by 1.125 (only keeping integer). The resulted number would represent an alphanumerical character, it ...
1
vote
1
answer
78
views
How keccak hashing and for loop happening in pure function?
I put a keccak hashing inside pure function, it works and return me the result.It also works in a for loop. I studied that hashing the data and loop consumes consider amount of gas. Do we need to ...
1
vote
2
answers
1k
views
Get hash transaction by your encode input data
In my application i must follow the use case:
I need to record any document hash on the Ropsten (eth testnet) blockchain. The hash is unique and i'm using a mapping in my smart contract to accomplish ...
0
votes
1
answer
171
views
Integrity of old blocks in the blockchain
I am learning Ethereum using Geth, and I am testing PoA-Clique networks. Now I have a conceptual doubt about old blocks integrity. Suppose I have a private blockchain network of only one miner node ...
0
votes
1
answer
900
views
Efficient way to save and retrieve hash in blockchain
I am learning Ethereum using Geth. I have a private blockchain and I am saving hashes through a REST API (python web service). I have readed I can save hash values using maps (mapping data type) and ...
0
votes
3
answers
792
views
From ENS Name to hash AND print in console
I'm just studying about Ethereum, ENS and and and..
Actually I try to compute an ENS .eth Name to a hash.
In
https://app.ens.domains/name
I baught a ENS .eth Name with the Ropsten Testnetwork.
Now I ...
4
votes
2
answers
3k
views
Gas cost of a sha256 hash
I'm confused about the cost of the sha256 function, because my understanding of the cost from the yellow paper ( https://ethereum.github.io/yellowpaper/paper.pdf (Appendix E. Precompiled Contracts) ) ...
0
votes
1
answer
278
views
How to parse ecrecover parameters?
I am looking into getting the public key from ANY ethereum address (not owned by me) that has sent a transaction at least once. It seems that the most viable solution here would be to use ethereumjs-...
2
votes
1
answer
2k
views
Different outputs for Keccak256(), which one is right?
To get a value from contract storage I used this geth code succesfully:
var contractAddress = '0x88e726de6cbadc47159c6ccd4f7868ae7a037730'
var index = '...
0
votes
2
answers
3k
views
How to cancel pending transaction of ethereum from exchange wallet? [duplicate]
How to cancel pending transaction of ethereum from exchange wallet? It is pending for around 36 hours now. There is no available tx hash.
0
votes
1
answer
2k
views
Solidity: extract data from signed message?
In an effort to reduce gas costs for users, I'm looking for a way to delegate certain transactions to a contract owner so that the owner makes a transactions that would have been otherwise sent by the ...
1
vote
1
answer
137
views
Off-chain authorization system
I'm working on a dapp and am running into a dilemma regarding how to balance trustlessness with the cost of transactions for users.
In order to reduce gas usage by users, I want to be able to able to ...
4
votes
5
answers
5k
views
How to generate the full list of function selectors for a contract?
A contract has many functions and how to automatically generate the full selector list, including inherited functions, for the whole contract?
Preferred solution shouldn’t require more than a web ...
1
vote
1
answer
982
views
How to find the value of erc20 token sent out using transaction hash
How can i find the value of erc20 token in a transaction using the hash generated?
I can't seem to find answers anywhere.
Edit:I found that it is possible to use w.eth.getTransactionReceipt('...
0
votes
1
answer
159
views
is it possible to use IPFS Hash to ensure file integrity?
My question is if i can use the IPFS Reference/Hash to ensure file integrity. In other words if i have a file can i use a specific Hashfunction to ensure that the generated Hash of that file is equal ...
1
vote
1
answer
660
views
What is the best way to store a hexadecimal value in an array in Solidity?
I am attempting to store a hash (web3.sha3) into an array in a smart contract.
What is the best way to do that?
1
vote
1
answer
104
views
Am I hashing the data in the file itself, or just the reference?
I am attempting to create an app where I upload a file to a website and then I submit a hash of that file onto Ethereum. I am unsure whether I am hashing the actual file below or just the reference to ...
1
vote
2
answers
3k
views
How to hash multiple values including array keccak256 Solidity v5.0.x and web3 'Autodetection of array types is not supported.'
How can I receive the same hash in solidity and web3?
Multiple values where one is a multi dimensional array.
Solidity v0.5.x:
pragma solidity 0.5.6;
pragma experimental ABIEncoderV2;
contract Hash{...
0
votes
3
answers
1k
views
web3.eth.sendSignedTransaction executed successfully but never any ETH transferred actually
as you see in below, i the raw transaction has been set by the gas simplify value, the returned value is an implemented transaction hashcode, but never assumed result by this transaction figure out
...
1
vote
1
answer
2k
views
Getting the transaction hash on function call
I am new to Solidity, Web3, and Ethereum.
I am trying to build a web application through which users can upload a file to IPFS, then store the IPFS hash in the blockchain. I am using the React truffle ...