Skip to content

Commit 05df605

Browse files
feat: add endpoint to get g1 and g2 pubkeys (#8)
* feat: add endpoint to get g1 and g2 pubkeys * break existing api for returning * break signer api too * update api * add getkeymetadata endpoint * update comment
1 parent ab1457c commit 05df605

File tree

10 files changed

+703
-108
lines changed

10 files changed

+703
-108
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
## cerberus-api
1+
# cerberus-api
22
This is the API spec of remote signer.
33
The spec currently only support BLS on bn254 signing.
44

5+
## Disclaimer
6+
🚧 Cerberus-api is under active development and has not been audited.
7+
Cerberus-api is rapidly being upgraded, features may be added, removed or otherwise improved or modified and interfaces will have breaking changes.
8+
Cerberus-api should be used only for testing purposes and not in production. Cerberus-api is provided "as is" and Eigen Labs, Inc. does not guarantee its functionality or provide support for its use in production. 🚧
9+
510
## Supported Bindings
611
### Go
712
The go bindings resides in [pkg/api/vi](pkg/api/v1) directory.

pkg/api/v1/key_manager.pb.go

Lines changed: 332 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/v1/key_manager.pb.gw.go

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/v1/key_manager_grpc.pb.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/v1/signer.pb.go

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/key_manager.proto

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ service KeyManager {
88
rpc GenerateKeyPair(GenerateKeyPairRequest) returns (GenerateKeyPairResponse) {}
99
rpc ImportKey(ImportKeyRequest) returns (ImportKeyResponse) {}
1010
rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) {}
11+
rpc GetKeyMetadata(GetKeyMetadataRequest) returns (GetKeyMetadataResponse) {}
1112
}
1213

1314
message GenerateKeyPairRequest {
@@ -18,14 +19,17 @@ message GenerateKeyPairRequest {
1819
}
1920

2021
message GenerateKeyPairResponse {
21-
// Public key hex of the generated keypair
22-
string public_key = 1;
22+
// G1 Public key hex of the generated keypair
23+
string public_key_g1 = 1;
2324

2425
// Private key hex of the generated keypair
2526
string private_key = 2;
2627

2728
// Mnemonic of the generated keypair
2829
string mnemonic = 3;
30+
31+
// G2 Public key hex of the generated keypair
32+
string public_key_g2 = 4;
2933
}
3034

3135
message ImportKeyRequest {
@@ -37,17 +41,41 @@ message ImportKeyRequest {
3741

3842
// Password to encrypt the private key
3943
string password = 3;
40-
4144
}
4245

4346
message ImportKeyResponse {
44-
// Public key hex of the imported keypair
45-
string public_key = 1;
47+
// G1 Public key hex of the imported keypair
48+
string public_key_g1 = 1;
49+
// G2 Public key hex of the imported keypair
50+
string public_key_g2 = 2;
51+
}
52+
53+
message PublicKey {
54+
// G1 Public key
55+
string public_key_g1 = 1;
56+
// G2 Public key
57+
string public_key_g2 = 2;
4658
}
4759

4860
message ListKeysRequest {}
4961

5062
message ListKeysResponse {
5163
// List of public keys
52-
repeated string public_keys = 1;
53-
}
64+
repeated PublicKey public_keys = 1;
65+
}
66+
67+
message GetKeyMetadataRequest {
68+
// Public key to get
69+
string public_key_g1 = 1;
70+
}
71+
72+
message GetKeyMetadataResponse {
73+
// Public key G1
74+
string public_key_g1 = 1;
75+
// Public key G2
76+
string public_key_g2 = 2;
77+
// Unix timestamp of when the key was created
78+
int64 created_at = 3;
79+
// Unix timestamp of when the key was last updated
80+
int64 updated_at = 4;
81+
}

proto/signer.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ service Signer {
99
}
1010

1111
message SignGenericRequest {
12-
// Public key of the keypair to sign with
13-
string public_key = 1;
12+
// G1 public key of the keypair to sign with
13+
string public_key_g1 = 1;
1414

1515
// Data to sign
1616
bytes data = 2;

0 commit comments

Comments
 (0)