npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

switchwallet-proto

v1.0.0

Published

SwitchWallet Protocol Buffers definitions for gRPC services

Readme

SwitchWallet Proto Contracts

The proto/ directory holds the Protocol Buffers definitions that describe how AsoRock (the orchestrator) and the city nodes (Lagos, Abuja, Enugu) talk to each other over gRPC. A single schema here becomes the shared source of truth for the request/response payloads, RPC method names, enums, and error codes used across all services.

What is a .proto file?

Protocol Buffers (a.k.a. “protobuf”) is a language-neutral serialization format from Google. A .proto file declares:

  • Services – the RPC endpoints and the request/response message types they use.
  • Messages – strongly typed data structures with numbered fields.
  • Enums – shared enumerations so all services agree on status values, error codes, etc.
  • Options – hints for language-specific code generation (e.g. package names).

When you compile a .proto, tooling generates idiomatic client/server stubs in your target language, guaranteeing the orchestrator and MPC nodes share the exact same contract.

Current contents

  • switchwallet.proto – Defines the ThresholdNode gRPC service with flows for interactive DKG, signing, and session event streaming. Inline comments also document the RSA metadata headers used for mutual authentication.

Using the contract

Generate code for each service at build-time (exact commands depend on the toolchain you adopt). A few common examples:

Rust (CGGMP21Node)

  • Crates: tonic-build + prost.
  • Typical build script snippet (build.rs):
    tonic_build::configure()
        .out_dir("src/generated")
        .compile(&["proto/switchwallet.proto"], &["proto"])?;
  • Import generated modules under switchwallet::v1::*.

Node.js / TypeScript (BlockPayBot)

  • Package options: grpc-tools + @grpc/proto-loader or ts-proto.
  • Example using ts-proto:
    npx protoc \
      --plugin=./node_modules/.bin/protoc-gen-ts_proto \
      --ts_proto_out=src/generated \
      --ts_proto_opt=env=node,outputClientImpl=grpc-js \
      proto/switchwallet.proto

Go (optional future service)

  • Tool: protoc-gen-go + protoc-gen-go-grpc.
  • Command:
    protoc \
      --go_out=./gen \
      --go_opt=paths=source_relative \
      --go-grpc_out=./gen \
      --go-grpc_opt=paths=source_relative \
      proto/switchwallet.proto

About the option go_package / java_package

The package options in switchwallet.proto simply tell generators which namespace or module path to use. They are placeholders for now:

  • go_package = "github.com/switchwallet/proto/switchwallet/v1" – update when you publish generated Go bindings, or remove if you do not target Go.
  • java_package, csharp_namespace – likewise, adjust when those ecosystems adopt the contract.

Rust (prost/tonic) ignores these options, so keeping them does not affect our current code.

Workflow notes

  1. Update switchwallet.proto when the cross-service contract changes.
  2. Regenerate stubs in each codebase (Rust, Node.js, etc.) during development or CI.
  3. Keep this README in sync with the tooling decisions so new team members understand how to consume the proto.

Last updated: 10 Nov 2025