Schema distribution
The .proto files in lib-derec/protobufs/ are the normative wire schema described in Messages. Every SDK package ships them, together with a compiled descriptor set, so an application can generate its own code — a gRPC client or server for the transport, a message decoder for tooling, a binding in a language DeRec does not ship — without a lib-derec checkout. The shipped schema always matches the package version it comes with.
What ships
The schema is 18 .proto files in the org.derecalliance.derec.protobuf package:
17 message files from
protobufs/protobufs/— the protocol vocabulary (derecmessage.proto,contact.proto,pair.proto,prepair.proto,storeshare.proto,verify.proto,getshare.proto,secretidsversions.proto,unpair.proto,updatechannelinfo.proto,transportprotocol.proto,result.proto,error.proto,communicationinfo.proto,parameterrange.proto,committedderecshare.proto,derecsecret.proto).1 transport contract from
protobufs/grpc/—derectransport.proto, theDeRecTransportgRPC service. It describes how envelopes are delivered, not what the protocol says; an implementation that reaches its peers over HTTPS needs nothing from it.
Alongside them ships derec_descriptor.bin: a FileDescriptorSet holding the complete import closure — every schema file plus the well-known types it imports (google/protobuf/timestamp.proto, google/protobuf/empty.proto). It is compiled with source info, so code generated from it keeps the protocol's doc comments.
The replica-sync payload (ReplicaSecretPayload, ChannelShare) and the Secret data model (Secret, HelperInfo, UserSecret, Replicas, ReplicaInfo) are not part of this schema. They are prost messages defined in Rust under crate::protocol::types; their fields and tags are listed under Secret payload.
Where each SDK puts it
Go
github.com/derecalliance/lib-derec/packages/go/derecpb/schema
schema.FileDescriptorSet ([]byte) and schema.Proto (an embed.FS with the files under proto/)
TypeScript
@derec-alliance/nodejs, @derec-alliance/web
proto/ and derec_descriptor.bin at the package root
React Native
@derec-alliance/react-native
schema/proto/ and schema/derec_descriptor.bin
.NET
DeRec.Library (NuGet)
schema/proto/ and schema/derec_descriptor.bin inside the .nupkg
The files are flattened into one directory, and every import in the schema is a bare filename, so a single include root resolves everything:
# npm packages
protoc -I node_modules/@derec-alliance/nodejs/proto \
--python_out=gen \
node_modules/@derec-alliance/nodejs/proto/*.protoFor the React Native and .NET layouts the include root is schema/proto. A generator that accepts a descriptor set can consume derec_descriptor.bin directly and needs no include path at all.
Rust
derec-proto already exports every message type (derec_proto::DeRecMessage, …). It generates no service stubs: prost emits messages and ignores services. To build a DeRecTransport client or server, generate it from the descriptor set the crate carries.
The descriptor feature exposes:
derec_proto::descriptor::FILE_DESCRIPTOR_SET—&[u8], the complete import closure, generated by the crate's build script from the crate's own sources.derec_proto::descriptor::transport_descriptor()— aprost_types::FileDescriptorSetreduced toderectransport.protoalone.
The schema is exposed as bytes rather than file paths, so it works under cargo vendor, a relocated CARGO_HOME, registry mirrors, and --offline.
The extern_path makes the generated service bind to the DeRecMessage type derec-proto already exports. Passing FILE_DESCRIPTOR_SET instead would emit a second, structurally identical set of message types that does not unify with the first; use it only when you want a standalone type set.
Other languages
Point the language's protobuf or gRPC generator at the shipped files. To produce a transport client or server, compile derectransport.proto; it imports derecmessage.proto, which pulls in every message it carries. The service and the messages share one package, so the full method name on the wire is org.derecalliance.derec.protobuf.DeRecTransport/Send regardless of where the file sits.
The library itself opens no socket. Whatever transport the application builds — gRPC from this schema, HTTPS, or anything else — plugs in through the SDK's transport interface; see TransportProtocol.
Last updated