Questions tagged [cryptography]

Discipline or techniques employed in protecting integrity or secrecy of electronic messages by converting them into unreadable (cipher text) form.

Filter by
Sorted by
Tagged with
109
votes
4answers
74k views

How are ethereum addresses generated?

What criteria does a valid ethereum address need to fulfil? Is it just a random number in hexadecimal? Or does it need to be derived in a specific way, according to some cryptographic algorithm? What ...
37
votes
3answers
16k views

Get public key of any ethereum account

Can I somehow get the public key of an ethereum account knowing just the corresponding ethereum address (e.g. 0x54dbb737eac5007103e729e9ab7ce64a6850a310)?
29
votes
6answers
16k views

ecrecover from Geth and web3.eth.sign

I have tried to use ecrecover() to verify the signature of a message. I have looked at lots of references here and elsewhere, like: https://lab-blog.ey.com/2016/12/19/ecrecover/ How does one ...
27
votes
5answers
9k views

How can I sign a piece of data with the private key of an Ethereum address?

I would like to use the key pair of one of my Ethereum accounts to sign a piece of data. How can this be done?
25
votes
1answer
4k views

When can BLOCKHASH be safely used for a random number? When would it be unsafe?

I've seen more complicated ways for a contract to generate a random number. But the Ethereum Yellow Paper itself suggests a "trivial solution" using the BLOCKHASH opcode (see below, bold is mine). ...
15
votes
1answer
2k views

Getting the wrong address back from ecrecover

When I sign a string using the following code I get back a different address to the one I signed with. The address returned is different for different strings. const util = require('ethereumjs-util') ...
27
votes
2answers
9k views

How to encrypt a message with the public-key of an Ethereum address

I am writing some code in nodejs/browser. I have successfully created ethereum-addresses with the secp256k1-library. I was also able to sign and verify messages. Now I want to encrypt/decrypt a ...
88
votes
2answers
50k views

Which cryptographic hash function does Ethereum use?

Many sources refer to the use of the "SHA3" cryptographic hash function within Ethereum, but the Ethereum project began before the SHA3 standard was finalised, and there was some confusion/controversy ...
19
votes
3answers
4k views

Account uniqueness guaranteed?

When we create an account in the Ethereum main network, how does the protocol guarantee the unique address of an account? Since even if we are not connected to the network we can create an account, is ...
35
votes
2answers
3k views

What's a precompiled contract and how are they different from native opcodes?

The Yellow Paper states: These are four so-called ‘precompiled’ contracts, meant as a preliminary piece of architecture that may later become native extensions. The four contracts in addresses ...
20
votes
2answers
6k views

Why aren't Solidity sha3 hashes not matching what other sha3 libraries produce?

Solidity has a function named sha3 and I tested it with an empty string input. It is not matching what other sha3 libraries produce. I see contracts written by others using the same sha3 function ...
18
votes
1answer
651 views

Out of Gas invoking precompiled contracts on private blockchains

Why do precompiled contracts lead to Out of Gas on private blockchains? Some tidbits are provided in the Solidity docs but can it be explained more? It might be that you run into Out-of-Gas for ...
23
votes
1answer
9k views

How can I verify a cryptographic signature that was produced by an Ethereum address key pair

If I have a cryptographic signature from an Ethereum address key pair, how can I verify that signature?
16
votes
2answers
4k views

Is it safe to reuse Ether addresses?

I believe it's viewed as unsafe in Bitcoin because of the way transactions are signed. Is this also true for Ether addresses?
20
votes
3answers
5k views

How does Oraclize handle the TLSnotary secret?

Oraclize claims to offer a provably honest secure retrieval of a webpage by taking advantage of TLSnotary (a service that allows an auditor to verify if a specific web page was accurately retrieved) ...
8
votes
1answer
4k views

Getting an address from ethereumjs-utils ecrecover

I am trying to sign a string using web3.eth.sign() and then get the public key I signed with from the signature. To do this I am using ecrecover() from ethereumjs-utils, which returns a buffer. When I ...
3
votes
1answer
496 views

How can we verify BGLS aggregate signatures in Solidity?

BGLS [1] is an aggregate signature scheme by Boneh et al., that allows aggregation of signatures on n different messages from n different signers. What I want to achieve is to verify such signatures ...
1
vote
4answers
2k views

Decryption in a smart contract

I have a key pair: The data is encrypted off-chain: and it is saved into the following smart contract: contract Foo { string data; } Can I decrypt stored data on-chain, assuming I provide a ...
24
votes
1answer
12k views

What does v, r, s in eth_getTransactionByHash mean?

In Ethereum JSON-RPC I found the return is: Returns Object - A transaction object, or null when no transaction was found: hash: DATA, 32 Bytes - hash of the transaction. nonce: QUANTITY - the number ...
25
votes
3answers
3k views

Is Ethereum secure against an attack by quantum computers?

Does Ethereum implement Post-quantum cryptography? Or will the network break once a malicious actor gains control of an effective quantum computer?
3
votes
1answer
412 views

Does Ethereum support pairing operations?

I need to build an application that uses bilinear pairing operations for generating signatures. If I send a message with its signature to Ethereum, can Ethereum verify this message? Does the EVM ...
11
votes
1answer
6k views

How can I verify a signature with the web3 javascript API?

Using the javascript web3 API I can create a signature like this: > web3.eth.sign(eth.coinbase, "0xdeadbeef") "...
10
votes
3answers
1k views

Can ZKSnarks be implemented on the Ethereum ecosystem?

Since Zcash seems to have it's ZKSnarks implementation finished (or almost at least). And versions of JPMorgan's Quorum had appeared with ZKsnarks implementations included see: https://www.coindesk....
11
votes
2answers
809 views

What are zkSNARKs? How do they work?

From my brief exposure to the concept, zkSNARKs seems to be a form of zero-knowledge cryptography. What can zkSNARKs bring to the table for Ethereum? I have looked at projects like this but still ...
2
votes
3answers
804 views

Will be a ring signature scheme possible to implement at Ethereum?

It's been quite a few days I'm wondering if a Ring Signature Scheme (like Monero (XMR) has) can be implemented on Ethereum blockchains. As far as I know, that will be so nice in order to increase ...
6
votes
1answer
269 views

Any understandable cryptography book/article/lecture to introduce to signatures, hashes, ECDSA etc..? [closed]

It's a long time I'm searching for cryptography lectures related to ethereum inside mechanisms, and everything I found has a high mathematical level. I'm an engineer, not a mathematics, so any article ...
6
votes
4answers
2k views

Proving the Existence of Logs to the Blockchain

To preface this: I'm not entirely sure this question makes any sense. Just a thought I had that I wanted to check the feasibility of. I'm pretty sure it is possible to use a Merkle proof to show that ...
12
votes
1answer
744 views

Ethereum signature verification not matching

What I want to achieve is sign a message and then verify the signature whether verified by same address or not. Contract to Invoke ecrecover method to verify the address contract MyAuth { ...
13
votes
1answer
5k views

arguments of the sha256 function in Solidity

In Solidity, I find that the sha256 function can be used like this a = sha256(uint b, string c, bool d, ......) (the arguments can be a combination of different types, and the other types can also be ...
5
votes
2answers
2k views

How to implement cryptographic algorithms in smart contracts?

I need to implement cryptographic algorithms such as AESCCM and elliptic curve algorithms (ECDSA, ECIES) within a smart contract. Is there any implementation of such algorithms in Solidity or Serpent? ...
5
votes
1answer
1k views

Ethereum Authentication/Authorization

Lately I've been thinking about how to integrate Ethereum with other non-Ethereum systems. Would it be a bad idea to import and Ethereum keypair into an external (mobile/desktop) application, which ...
7
votes
2answers
567 views

How does the system enforce correct execution of smart contracts?

If I understand correctly, the smart contracts are run by the miners. What incentive do the miners have to execute the smart contracts correctly? What stops a malicious miner from changing the result, ...
2
votes
1answer
616 views

Understanding Ethereum signatures

I would like to understand exactly which signatures are used in the Ethereum. Here https://bitcoin.stackexchange.com/questions/12554/why-the-signature-is-always-65-13232-bytes-long it says that there ...
0
votes
1answer
572 views

R,S,V ECDSA packet signatures

I am using BouncyCastle to generate .NET core packet signatures. I want to be able to get the v value for the Ethereum signature. To these ends, and with my understanding of the meaning of the v ...