-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Construction API (formerly Wallet API) #21
Conversation
f3585d7
to
df91ca9
Compare
df91ca9
to
c202949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1000000 🔥
CurveType is the type of cryptographic curve associated with a PublicKey. | ||
|
||
* secp256k1 = SEC compressed 33-bytes. | ||
* edwards25519 = y (255-bits) || x-sign-bit (32-bytes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way this is documented is a little bit confusing which is my bad for stating it like this in the other doc.
This reads like the public key is 255-bits + 32-bytes which isn't true. It's 255-bits + 1-bit for a total of 32-bytes. It may be worth clarifying that here.
It also could be beneficial to link to documentation on where these encodings are described elsewhere.
For Ed25519, it's page 6 of the paper here: https://ed25519.cr.yp.to/ed25519-20110926.pdf
For secp256k1, the compressed encoding is here: https://secg.org/sec1-v2.pdf#subsubsection.2.3.3
Construction API implementation. | ||
|
||
### Supported CurveTypes | ||
* secp256k1: 1SEC compressed 33-bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks to be an extra 1 here before "SEC"
Nicely done! 💪 |
Thanks for these callouts @jakecraige, I'm working on another PR prior to cutting the release and can work these fixes in there! |
Motivation
To support universal writes to any blockchain, we need to introduce a new collection of endpoints to complement our existing
Data API
ones.Solution
Endpoints
Add support for generic transaction construction using the new endpoints (which must work entirely offline):
/construction/derive
/construction/preprocess
/construction/payloads
/construction/combine
/construction/parse
/construction/hash
In addition to the existing endpoints (which can be online):
/construction/metadata
/construction/submit
Data API Flow
Construction API Flows
Offline Mode (construction metadata fetched by caller)
Online Mode (construction metadata fetched by Construction API implementation)
Future Work
v1.4.0
+ cleanup old docs to ensure consistent with new endpoints.