Comments (5)
After some discussion, we decided on:
- Adapt the precompile to accept arbitrary-length messages.
func Verify(msg []byte, pubkey [32]byte, signature [64]byte) uint32
- Modify the serialized precompile input format to include 1 variable-length argument (the message)
- serialized format to be defined as
pubkey || signature || message
where||
is concatenation
- serialized format to be defined as
- Modify gas costs to account for the internal sha-512
This should preserve full compatibility with other PureEdDSA
and HashEdDSA
implementations
from celo-proposals.
FYI: I've just published the initial PR
from celo-proposals.
If I recall correctly, ed25519 specifies sha2-512 (64-byte messages) while the proposal specifies 32-byte messages. For full compatibility with the ed25519 spec
- Should message size be 64 (and support a 32-byte operating mode)?
- Should CIP-20 add support for sha2-512?
from celo-proposals.
Went and reviewed RFC 8032. It looks like this is the prehash function PH(M)
(see section 4). We do not need to support PureEdDSA, and for HashEdDSA the prehash can be parameterized by any collision-resistant hash function. I guess the question then is whether common cryptographic protocols we want to verify use 64-byte hashes. What does Cosmos use?
from celo-proposals.
ah hmm. I guess that I had been thinking of this as a Raw verify function func VerifyRaw(msgHash []byte, pubkey [32]byte, signature [64]byte) uint32
where msgHash
is almost always 32 or 64 bytes. Edit: Apparently this concept doesn't precisely apply to EdDSA because it always uses sha512 internally
Currently as specced it's Verify(msg [32]byte, pubkey [32]byte, signature [64]byte) uint32
. This results in the 32 byte message being hashed with Sha512 again in the eddsa library I believe. This would create compatibility issues with almost any use case (including cosmos-sdk, I believe) so it seems like we'll want to switch to the raw variant 🤔
from celo-proposals.
Related Issues (20)
- Celo All-Core Devs Call 9 HOT 3
- CIP 45 - Modify Transaction Fee Check - Discussion
- Celo Wallet Council Call 2 HOT 2
- CIP 46 - Processes Around Granda Mento Exchanges - Discussion
- CIP 47 - Round Change Timeout Formula Modification - Discussion
- CIP 48 - EIP-2929 Modifications for Celo - Discussion
- Celo Wallet Council Call 3 HOT 7
- Celo Wallet Council Call 4 HOT 7
- CIP 49 - Transaction Signature Safety - Discussion HOT 4
- Celo Wallet Council Call 5 HOT 7
- CIP 50 - Optional Replay Protection - Discussions
- Celo All-Core Devs Call 10 HOT 1
- Optics Council Call HOT 2
- Celo Wallet and (d)App Council #6 HOT 5
- Celo Wallet and (d)App Council #7 [February] HOT 12
- [ASv2 MVP] SDK/adapter to interoperate with ASv1/2 credentials HOT 1
- Celo Wallet and (d)App Council #8 [March] HOT 3
- Problem sending wrong money
- Celo All-Core Devs Call #11
- invalid discord link in ip-0000.md file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from celo-proposals.