Comments (12)
starknet-crypto
does contain the logic of decompressing public keys as it needs to do that for verifying signatures. See this line:
starknet-rs/starknet-crypto/src/ecdsa.rs
Line 94 in bad876c
However as of today, this functionality is an implementation detail and not exposed as part of the public API. If you need to use it, the best way to do that today would be to fork this repository and expose the function yourself.
from starknet-rs.
Optimistically closing this. Feel free to re-open if you have further questions on the topic.
from starknet-rs.
Hi @rhobro I noticed you just forked our library, and just want to remind you that we just discovered a critical bug which causes the decimal representation of FieldElement
to be incorrect. This bug is currently tracked as #74.
So if you print out the coordinates you get, you'll be getting incorrect numbers. You might want to incorporate the fix once it's implemented (very soon).
from starknet-rs.
@xJonathanLEI thank you very much for the update. Please could you ping me on this issue when it's sorted? I'll then update the commits on the fork.
Thank you so much for letting me know.
from starknet-rs.
Sure thing :)
from starknet-rs.
The commit fixing the issue is on master
now @rhobro
from starknet-rs.
That was rapid. Thanks man.
from starknet-rs.
I forked it and exposed just the logic to get the y coordinate which I found in EcPoint::from_x. It is amazing that it was the same logic I found on the starkware website.
Out of interest @xJonathanLEI, would it be possible to be able to do arithmetic with references to FieldElements rather than having to clone them to pass into a function?
from starknet-rs.
Yeah I'd expect the same logic to be used everywhere. I guess that means we have a correct implementation :)
As for using references for arithmetic, yes we will be implementing ops that take references alongside the existing ones. However, I'd say you shouldn't worry about this for performance reasons (I'm presuming you're trying to do it for performance reasons; please ignore me if that's not the case :)), as this will be taken care of by the Rust optimizer.
from starknet-rs.
I was trying to do it for performance reasons
from starknet-rs.
Obviously you'd need to benchmark for your case yourself, but generally speaking, if ownership is taken without being used, the compiler might turn it into a reference instead, depending on a lot of factors including the size of the struct in question.
from starknet-rs.
Ok. Thanks for the info.
from starknet-rs.
Related Issues (20)
- Update JSON-RPC specs to 0.15.0 HOT 2
- Type `ProviderError` is not public HOT 12
- JSON RPC batching HOT 6
- `get_selector_from_name` argument lifetime HOT 3
- Bug: FeeEstimate "amount" is now named "overall_fee" with StarkNet 0.9.1 HOT 1
- Add support for StarkNet v0.9.1
- Support JSON-RPC specification v0.1.0
- Handle gateway response errors HOT 2
- Add support for StarkNet v0.10.0 HOT 1
- Add examples for interfacing with `cairo-rs` (Cleopatra) HOT 3
- Contract class hash equivalence with cairo-lang HOT 1
- Add support for StarkNet v0.10.1 HOT 2
- Revamp contract deployment HOT 6
- Port more Pedersen hash performance improvements from `pathfinder` HOT 1
- Add wasm benchmark
- WebAssembly performance issue HOT 1
- Any plans to export `starknet_crypto` in `starknet`? HOT 2
- Support JSONRPC spec 0.2.1
- Add support for StarkNet v0.10.2
- Any plans to support simulate transactions from account contracts? 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 starknet-rs.