-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from coinbase/patrick/construction-api
Add Construction API (formerly Wallet API)
- Loading branch information
Showing
9 changed files
with
1,354 additions
and
45 deletions.
There are no files selected for viewing
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" |