-
Notifications
You must be signed in to change notification settings - Fork 95
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
659fba7
Add address derivation
patrick-ogrady b551e36
prepare_metadata functions
patrick-ogrady 3084dba
Add create_payloads
patrick-ogrady 5b9fc9d
Combine signatures support
patrick-ogrady 0a9b8ec
Add support for parse
patrick-ogrady f770135
Add support for transaction hash
patrick-ogrady bb04f77
nits
patrick-ogrady 684bc66
Update endpoints
patrick-ogrady 8ceeec4
Add flows to README
patrick-ogrady c202949
Update README with more explanation and context
patrick-ogrady 60bb7f2
Update api.yaml
patrick-ogrady 51087f4
Add docs for new models
patrick-ogrady 982f089
Add notes about signature schemes
patrick-ogrady 8cda1ad
Add crypto formats
patrick-ogrady 0b14bba
Fix double space issue
patrick-ogrady e0d1558
Add supported curvetypes and signaturetypes to README
patrick-ogrady 5d36140
run make gen
patrick-ogrady bae09da
nits
patrick-ogrady File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
description: | | ||
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). | ||
type: string | ||
enum: | ||
- secp256k1 | ||
- edwards25519 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
description: | | ||
PublicKey contains a public key byte array | ||
for a particular CurveType encoded in hex. | ||
|
||
Note that there is no PrivateKey struct as this | ||
is NEVER the concern of an implementation. | ||
type: object | ||
required: | ||
- hex_bytes | ||
- curve_type | ||
properties: | ||
hex_bytes: | ||
type: string | ||
description: | | ||
Hex-encoded public key bytes in the format | ||
specified by the CurveType. | ||
curve_type: | ||
$ref: "CurveType.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
description: | | ||
Signature contains the payload that was signed, the public keys of the | ||
keypairs used to produce the signature, the signature (encoded in hex), | ||
and the SignatureType. | ||
|
||
PublicKey is often times not known during construction of the signing payloads | ||
but may be needed to combine signatures properly. | ||
type: object | ||
required: | ||
- signing_payload | ||
- public_key | ||
- signature_type | ||
- hex_bytes | ||
properties: | ||
signing_payload: | ||
$ref: "SigningPayload.yaml" | ||
public_key: | ||
$ref: "PublicKey.yaml" | ||
signature_type: | ||
$ref: "SignatureType.yaml" | ||
hex_bytes: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
description: | | ||
SignatureType is the type of a cryptographic signature. | ||
|
||
* ecdsa = r (32-bytes) || s (32-bytes) | ||
* ecdsa_recovery = r (32-bytes) || s (32-bytes) || v (1-byte) | ||
* ed25519 = R (32-byte) || s (32-bytes) | ||
type: string | ||
enum: | ||
- ecdsa | ||
- ecdsa_recovery | ||
- ed25519 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
description: | | ||
SigningPayload is signed by the client with the keypair associated | ||
with an address using the specified SignatureType. | ||
|
||
SignatureType can be optionally populated if there is | ||
a restriction on the signature scheme that can be | ||
used to sign the payload. | ||
type: object | ||
required: | ||
- address | ||
- hex_bytes | ||
properties: | ||
address: | ||
type: string | ||
description: | | ||
The network-specific address of the account that should sign | ||
the payload. | ||
hex_bytes: | ||
type: string | ||
signature_type: | ||
$ref: "SignatureType.yaml" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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