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
2answers
26 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 ...
0
votes
0answers
14 views

Blackjack - keep dealer second card hidden

I am working on a multiplayer blackjack implementation with an array of 52 cards as the deck that have a flag if they're selected or not. I'm implementing a random number generator to choose a random ...
0
votes
0answers
27 views

Can you verify transaction data by matching it to the transaction hash

TlDr; Can you use the transaction hash to confirm the integrity of the data components of a transaction (post data, addresses, nonce, etc). In my application, I have a connection to the Ethereum ...
2
votes
2answers
64 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
1answer
30 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
1answer
69 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
2answers
103 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
1answer
58 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
1answer
50 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 ...
0
votes
3answers
128 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 ...
0
votes
1answer
50 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
1answer
32 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 ...
0
votes
1answer
27 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
1answer
38 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 ...
0
votes
1answer
131 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
3answers
234 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
1answer
90 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 ...
0
votes
0answers
17 views

Parity synced at not existing block 4839212

I have problem with parity, cant get synchronization in archive mode to end, anything, changing arguments, max-, min-, snapshot-peers, parity verisions do not help. I have blockchain in archive mode ...
0
votes
1answer
45 views

Hash bytes32 and uint32 in Soldiity 0.5.8

How can we efficiently calculate a hash value for a combination of bytes32 and integer value? Like in JavaScript "someString" + someInt. I tried: function fx(bytes32 _left, uint32 _right) public ...
2
votes
1answer
37 views

How to retrieve transaction hash value from the Promise object using web3js?

I'm trying to retrieve the transaction hash value after I call my smart contract method. My Promise object looks like below. returnPromise: Promise { "pending" } ​ <state>: "...
1
vote
1answer
43 views

How to encode function call in C

I understand web3 can be basically used for every existing task, however, is there anything we can use for C? My C program is communicating with the RPC server using the curl library, by posting JSON ...
0
votes
1answer
45 views

Costs/efficiency of locating stored data on Ethereum

Based on the answer to this question, storing IPFS hashes on Ethereum could be done in 3 ways: Store it as a string Store it as a struct Store it in event log Ordered from most expensive to least ...
1
vote
1answer
299 views

Ideal way to store hash on the ethereum blockchain

I would like to store a certificate on the blockchain. I only need to store its hash and if its been verified by both parties or not. Should I create a struct that is made up of bytes32 for the hash, ...
0
votes
0answers
107 views

How does a message signed in Remix IDE?

What is signing method that is used in remix IDE and how is the hash value calculated from the message that is being signed?
0
votes
1answer
406 views

Block header hash calculation [duplicate]

What inputs go into the RLP and Keccak function to calculate the block header hash? I looked up the header struct. Which of those values are fed into the RLP, Keccak? Were nonce and mixed hash left ...
1
vote
1answer
147 views

block hash from block-header rlp [duplicate]

Given the RLP of a block header, how do i get the block hash? https://github.com/ethereum/go-ethereum/blob/master/core/types/block.go#L99 The above link says: Hash returns the block hash of the ...
5
votes
1answer
342 views

block-header hash verification

As part of a validation service I am working on, I need to be able to verify that the blockHeader hash was created correctly. Based on my understanding following are the steps to regenerate the header ...
3
votes
1answer
53 views

How to create and compare a 32 byte hash of a string in solidity 0.5

I simply want to create a 32 byte hash of a string and compare equality to another one, but this is proving almost impossible for some reason. E.g: hash("a") == hash("b") My compiler throws errors ...
0
votes
1answer
60 views

How network hashrate is being calculated? [duplicate]

Hashrate The number of attempts that miner makes per second is known as the hash rate or hash power. Network's hashrate It is the most important data point in blockchain tech. ... Essentially, the ...
0
votes
1answer
47 views

i want to get data from the transaction hash i tried many codes at last i am getting boxes in the output

1) First, I got the input console.log(web3.eth.getTransaction('0x725fc75264726f409793164e336e7d5ed35df8d2be469a0cc1a3a8cc4756b9b9').then((i) => console.log(i) )); 2) I manually pasted the input ...
0
votes
1answer
79 views

Match web3py hashing function to solidity hashing function

If I am using web3py to hash some data, like so, msgHash = w3.soliditySha3(['bytes32','bytes32'], [dataBytes, saltBytes]); What would be the correct way to hash inside of a Solidity contract and ...
1
vote
1answer
34 views

For Recipient how do I store Sender's account address and Password of Recipient's own account in hashed from?

How to check following things using Solidity: Password matching (hash formed) if password matches then transfer take place
0
votes
0answers
73 views

Can I use an address value in such a hash function

I have a method which updates 3 mappings in my contract. To save data I use some items properties and message sender address, which allows easily to get users data. mapping(bytes32 => uint256) ...
2
votes
1answer
136 views

How do I use SoliditySha3 in Nethereum?

According to this, web3 should contain the function soliditySha3. It can take an object (JSON), serialize it, and use the result as input to Keccak256. According to the documentation, the arguments ...
1
vote
1answer
114 views

Hash functions soldity to python

In Solidity, I run the following code: function hashTest() public returns(bytes32,bytes32,bytes32) { bytes32 _solution = 0xbc756c25d68ea2f260ea5f15e1e1c734c019cbc014270dd386eacca4699f60f6; bytes32 v ...
1
vote
1answer
38 views

How will Proof of Stake affect blockhash generation

When (and if) Ethereum switches to proof of stake, how will the hash of blocks (most likely) be set?
1
vote
0answers
69 views

Does web3 soliditySha3 work with json object?

The above hash data is generated by web3 soliditySha3 with the objects below. It seems the function generates hashes as I wanted; each object has different hash value. But I am not sure if it's ...
2
votes
0answers
80 views

Can we use Ethereum Swarm to store normal data other than blockchain or dapp data.

I want some basic data to be stored like name and city phone no etc.So just want to ask can I use ethereum swarm just to store file and make several node to create decentralized storage.
0
votes
2answers
641 views

Encrypt data using public key

I have three data fields in a form which will return a string. I would like to hash the value of these three strings and store it in the blockchain. However the data in these three strings is ...
1
vote
1answer
160 views

get same output as solidity SHA256 in JS

Is there a js function/library which gives same output as sha256 in solidity? I am saving a hash in a mapping and can access it via cli (truffle console) and see what the hash is but I would like to ...
0
votes
1answer
126 views

Is data inputted as a parameter for a smart contract function visible?

Let's say I have something like this: bytes32 person; function registerPerson(address _person) public { bytes32 x; x = sha256(abi.encodePacked(_person)); person = x; } For privacy reasons, ...
1
vote
1answer
51 views

Hashing header “offline” python

I am trying to prove that the TransactionsRoot and the ReceiptsRoot do belong to a specific block. So that I can verify without web3 that all the transactions and receipts actually belong to this ...
2
votes
1answer
34 views

How to get two points (x, y) from an encoded pubkey?

this gives a valid address from two points; address(uint256(keccak256(abi.encodePacked(point[0], point[1]))) & 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); but does that mean that if you are ...
1
vote
1answer
457 views

Creating hash of a struct in Solidity and JavaScript

I have created a message hash in JavaScript using: let message = { 'message': 'Receiver closing signature', 'sender': sender, 'balance': value }; message = web3.utils.toHex(...
0
votes
1answer
28 views

Creating an Ethereum id Hash

I'm trying to understand how to convert my transaction data into the id hash before signing the transaction. Let's say I have this data: transaction = { 'to': to_address, 'from': ...
0
votes
1answer
51 views

Checksum vs. Hash: Differences and Similarities ? [closed]

What are similarities and differences between a "checksum" algorithm and a "hash" function? Can they be used instead of each other? Or their usage are different? For example, for verifying the ...
0
votes
2answers
44 views

retrieving an original data from a hash: is it reliable?

Normally, one of the purposes of hashing a string (such as a transaction) is summarizing the data to save the size because of the space limitation. If this proposition is true, now assume we need to ...
0
votes
1answer
286 views

messageHash hash function

In this example, by which algorithm is messageHash hashed by? web3.eth.accounts.sign("Hello, world!", '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') { message: 'Hello, world!', ...
4
votes
2answers
640 views

How is the keccak256(a, b) function implemented?

I need to understand how keccak256(a, b) is implemented and how it differs from keccak256(a || b). Is the content padded? I need this because I do not want to allow for vulnerabilities where a user ...
3
votes
1answer
101 views

How does knowing the root hash of a past world state help me to revert to this world state?

In section 4.1 of the Ethereum yellow-paper (http://gavwood.com/Paper.pdf) the following is written: The world state (state), is a mapping between addresses (160-bit identifiers) and account ...