toposware / schnorr-sig Goto Github PK
View Code? Open in Web Editor NEWA custom Schnorr signature scheme using Rescue-Prime hash internally for fast verification in zk-STARK statements.
License: Apache License 2.0
A custom Schnorr signature scheme using Rescue-Prime hash internally for fast verification in zk-STARK statements.
License: Apache License 2.0
We currently rely on rescue_63_14_7
for hashing the transaction in our modified Schnorr signatures.
It represents currently 25% and could be brought down to ~11/12% by using Poseidon for instance, at the cost of a light increase in the AIR program (we could still use Rescue for the Merkle authentication paths and replace only the signature hashing).
The current hash of the message before signing is computed as
for chunk in message.chunks(8) {
message_fp.push(Fp::from_bytes(&chunk.try_into().unwrap()).unwrap());
}
data.extend_from_slice(&message_fp);
This implies that any non-canonical chunk will be making Fp::from_bytes()
panic. We should take chunks of 7 bytes instead, similarly to how binary data slices are hashed, to ensure canonical representation once converted to field elements.
We currently rely on RP-14-7 for convenience in the previous prototype of the state transition AIR program in https://github.com/Toposware/certificate-stark. It however would be more efficient to switch for another instantiation, either RP-8-4 or RP-12-8.
Somehow related to #3, if we decide to stick to Rescue-Prime for the underlying hash function.
Unlike regular binary hash functions, we are hashing entire field elements here (there exists a method for hashing a sequence of bytes but in the context of an AIR program we would stick to hashing entire field elements). Because of that, the "indicator" for the y-coordinate is heavy, namely 1 entire field element of 64 bits.
Changing this to no extra information, and instead deserialize public keys solely from x-coordinates by choosing always the lexicographically largest corresponding y-coordinate would save 2 field elements for signatures of regular account transfers (1 sender / 1 receiver / extra data). If we consider the extra data to be the amount to be sent (128bits) and the sender's nonce (64 bits), this accounts for a total of
Let
The current instantiation is parameterized as RP-8-4
, i.e.
We also know that with Rescue-Prime, to maintain a security level of 128 bits, we need to have a capacity
The other existing instantiation, RP-14-7
would need only 3 iterations if
We are also concerned about the number of constrained cells at a given frame, which is directly linked to the size of the hash state (
This would require:
RP-12-8
instantiation in Toposware/hashPublicKey
s are handled to reduce encoding to 48 bytes (cleaner)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.