Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/layr-labs/cerberus-api
API Spec for remote signer
https://github.com/layr-labs/cerberus-api
bn254
Last synced: 16 days ago
JSON representation
API Spec for remote signer
- Host: GitHub
- URL: https://github.com/layr-labs/cerberus-api
- Owner: Layr-Labs
- License: other
- Created: 2024-10-08T00:59:28.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-10-16T21:40:56.000Z (29 days ago)
- Last Synced: 2024-10-20T09:46:38.469Z (26 days ago)
- Topics: bn254
- Language: Makefile
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## cerberus-api
This is the API spec of remote signer.
The spec currently only support BLS on bn254 signing.## Supported Bindings
### Go
The go bindings resides in [pkg/api/vi](pkg/api/v1) directory.## Signing Quirks
If you are implementing a version of this, please make sure to check [this code](https://github.com/Layr-Labs/remote-bls/blob/55a19a0386edcee1b5c2ecae116ae468a6b2b47b/internal/crypto/utils.go#L30-L36)
for implementation of sign and verify. If you use any other implementation, the signatures will not be compatible with EigenLayer contracts.
Eventually we will support more `HashToCurve` algorithms.## Implementation
* Go - https://github.com/Layr-Labs/cerberus (Coming Soon)
## Usage
### Signing Client
```go
package mainimport (
"context"
"fmt"
"log"
"time""github.com/Layr-Labs/cerberus-api/pkg/api/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)func main() {
conn, err := grpc.NewClient(
"localhost:50051",
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
log.Fatalf("did not connect: %v", err)
}
defer conn.Close()
c := v1.NewSignerClient(conn)ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()req := &v1.SignGenericRequest{
PublicKey: "0xabcd",
Password: "p@$$w0rd",
Data: []byte{0x01, 0x02, 0x03},
}
resp, err := c.SignGeneric(ctx, req)
if err != nil {
log.Fatalf("could not sign: %v", err)
}
fmt.Printf("Signature: %v\n", resp.Signature)
}
```## Security Bugs
Please report security vulnerabilities to [email protected]. Do NOT report security bugs via Github Issues.