SDK for Silent Network
In this section we briefly introduce SDKs used to communicate with Silent Network. The most up to date version of the requests schema, API and examples are always documented in the SDKs, please refer there for exact usage.
Most of those resources are hidden from public view. Reach out to us, to access them.
Rust
The Rust crates, are used to build the service (WPBE in our architecture diagrams), that will communicate with the Network.
- Docs https://shipyard.rs/silencelaboratories/wallet-provider-service-sdk/latest/docs
- Crate https://shipyard.rs/silencelaboratories/crates/wallet-provider-service-sdk
- Respository https://github.com/silence-laboratories/el-services/tree/main/crates/wallet-provider-service-sdk
- Reference WPBE service that uses the SDK.
- Examples https://github.com/silence-laboratories/examples-hub/tree/v0.1.0/silent-network/with-rust
Golang
The Go package, are used to build the service (WPBE in our architecture diagrams), or client that will communicate with the Network.
- Docs, https://wallet-provider-go-sdk.silencelaboratories.com/github.com/silence-laboratories/wallet-provider-go-sdk?token=zRHhHxdwIVSP0k4Cp7YhGOuuvQbg0No6
- Repository and the Package https://github.com/silence-laboratories/wallet-provider-go-sdk
- Examples https://github.com/silence-laboratories/examples-hub/tree/v0.1.0/silent-network/with-go
TypeScript
TypeScript SDK can be used in frontend development, or as a backend client to the WPBE.
- Docs https://walletprovider-sdk.docs.silencelaboratories.com/.
- Package https://www.npmjs.com/package/@silencelaboratories/walletprovider-sdk
- Repo https://github.com/silence-laboratories/walletprovider-sdk
- Examples https://github.com/silence-laboratories/examples-hub/tree/v0.1.0/silent-network/with-typescript
SDK Examples
We provide learning resources for the SDK usage, please check:
- Our tutorial for creating Web3 Wallet as the quickstart of following SDKs.
- Our Examples Hub, presenting useful snippets.
Go play with our Web3 Wallet Demo written with Typescript SDK here.
Endpoints versions
Silent Network has two versions of the endpoints v1 and v2.
The v1 endpoints follows challenge-response protocol, preventing replay attack, however extending request execution.
The v2 endpoints do not utilize chal-resp mechanism. Hence it's important to ensure request replay attack is not a concern.
Some functionality might be present in v1 but not in v2, see here for the breakdown.
The v1 endpoints are enabled only for Network with User auth architecture.
The SDK's takes care of the request format, and how to connect to the service, so you don't need to worry about it. However when using the SDK, you must decide on the endpoint version you want to use.
How to choose the endpoint version
Use v1 if:
- There is no equivalent under
v2, like Passkey registration. - In your system architecture between end-user and the Network there is some distrusted party that sees the end-user request in plaintext, and could send it multiple times to the network.
SDK functionality breakdown
| Feature | ECDSA | EDDSA | V1? | V2? | Supported in no-auth architecture? | SDK | Details |
|---|---|---|---|---|---|---|---|
| Keygen | ✅ | ✅ | ✅ | ✅ | ✅ | TS, Rust, Go | |
| Signgen | ✅ | ✅ | ✅ | ✅ | ✅ | TS, Rust, Go | |
| Add ephemeral key | ✅ | ✅ | ✅ | ✅ | N.A. | TS, Rust, Go | |
| Revoke ephemeral key | ✅ | ✅ | ✅ | ✅ | N.A. | TS, Rust, Go | |
| Passkey registration | N.A. | N.A. | ✅ | ❌ | N.A. | TS | Registration uses chal-resp by definition |
| Init presign | ✅ | ❌ | ❌ | ✅ | ✅ | TS, Rust | No need for presigns for EdDSA |
| Finish presign | ✅ | ❌ | ❌ | ✅ | ✅ | TS, Rust | |
| Key refresh | ✅ | ✅ | ✅ | ❌ | ❌ | TS, Rust | We plan to support refresh in no-auth under v2 |
| Quorum change | ✅ | ✅ | ❌ | ✅ | ✅ | Go | More SDK support soon |
| Key Import | ✅ | ✅ | ❌ | ✅ | ✅ | Rust | |
| Key Export | ✅ | ✅ | ❌ | ✅ | ✅ | Rust, Go | Go uses bindings to Rust here |