Protocol Buffer Configuration
⚠️ XRP Protocol Buffers DEPRECATED
Status:
proto/rippleapi/is DEPRECATED and no longer used.Reason: XRP functionality migrated to native Go implementation using xrpl-go libraries. gRPC architecture (
apps/xrpl-grpc-server/) has been replaced.Current State: This document remains for reference but proto files are no longer actively maintained or generated for XRP.
This document describes the Protocol Buffer (protobuf) setup in go-crypto-wallet.
Edition 2024
This project uses Protobuf Edition 2024, the latest edition of Protocol Buffers.
What are Protobuf Editions?
Editions replace the old syntax = "proto2" / syntax = "proto3" declarations with a more flexible system:
- Edition 2023: First edition, unifies proto2 and proto3 behaviors
- Edition 2024: Latest edition with improved defaults and features
Reference: Protobuf Editions Overview
Why Edition 2024?
- Future-proof: Adopts the latest protobuf features
- Better defaults: Improved naming conventions and field presence semantics
- Compatibility: Uses feature flags for backward compatibility
Proto Files [DEPRECATED]
Location: proto/rippleapi/ [DEPRECATED - No longer used]
| File | Description | Status |
|---|---|---|
account.proto | XRP account information API | ❌ Deprecated |
address.proto | XRP address generation API | ❌ Deprecated |
transaction.proto | XRP transaction API | ❌ Deprecated |
Note: All XRP proto files are deprecated. XRP functionality now uses native Go implementation.
Feature Flags
Each proto file uses the following feature flags for backward compatibility:
edition = "2024";
// Use proto3 semantics for field presence (implicit presence)
option features.field_presence = IMPLICIT;
// Allow existing camelCase field names without requiring snake_case
option features.enforce_naming_style = STYLE_LEGACY;Code Generation [DEPRECATED for XRP]
⚠️ Note: Proto code generation is no longer needed for XRP. Commands below are kept for reference only.
Recommended: protoc (for Edition 2024)
make proto # ⚠️ No longer generates XRP filesThis uses protoc directly, which fully supports Edition 2024.
Requirements:
protoc>= 33.0protoc-gen-go(Go code generator)protoc-gen-go-grpc(gRPC code generator)
Alternative: buf (for future use)
make proto PROTO_TOOL=bufNote: As of January 2026, buf CLI v1.63.0 does not yet fully support Edition 2024. The command will fail with:
edition "2024" not yet fully supported; latest supported edition "2023"Once buf adds Edition 2024 support (>= 1.64.0), change the default PROTO_TOOL in make/codegen.mk to buf.
Proto Formatting (clang-format)
Since buf CLI v1.63.0 doesn't support edition 2024, use clang-format for proto formatting:
make proto-fmt # Format proto files with clang-format (recommended)
make proto-fmt-check # Check formatting (used in CI)Requirements:
clang-format(install viaapt install clang-formatorbrew install clang-format)
buf Utilities (Limited with Edition 2024)
Note: As of buf CLI v1.63.0, the following commands fail with edition 2024:
make proto-fmt PROTO_TOOL=buf # ❌ Fails - edition 2024 not supported
make proto-lint PROTO_TOOL=buf # ❌ Fails - edition 2024 not supported
make proto-breaking # ✅ Works with continue-on-errorbuf lint is temporarily disabled in CI. Re-enable when buf >= 1.64.0 adds edition 2024 support.
Generated Code
Output: internal/infrastructure/api/xrp/protogen/
Opaque API Pattern
Edition 2024 generates Go code using the "opaque" API pattern:
Before (Edition 2023 / proto3):
// Direct field access
msg := &protogen.Instructions{
Fee: "10",
MaxFee: "100",
}
value := msg.FeeAfter (Edition 2024):
// Builder pattern for construction
msg := protogen.Instructions_builder{
Fee: "10",
MaxFee: "100",
}.Build()
// Getter methods for access
value := msg.GetFee()
// Setter methods for mutation
msg.SetFee("20")Migration Notes
When upgrading from Edition 2023 to 2024:
- Update struct literals to use
*_builder{}.Build()pattern - Replace direct field access (
msg.Field) with getters (msg.GetField()) - Use setters (
msg.SetField()) for mutation
Configuration Files
buf.yaml
version: v2
modules:
- path: proto/rippleapi
name: buf.build/hiromaily/go-crypto-wallet-rippleapi
lint:
use:
- BASIC
except:
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
- FIELD_LOWER_SNAKE_CASE
- PACKAGE_DIRECTORY_MATCH
- PACKAGE_SAME_DIRECTORY
- DIRECTORY_SAME_PACKAGEbuf.gen.yaml
version: v2
managed:
enabled: false
plugins:
- remote: buf.build/protocolbuffers/go
out: internal/infrastructure/api/xrp/protogen
opt:
- paths=source_relative
- remote: buf.build/grpc/go
out: internal/infrastructure/api/xrp/protogen
opt:
- paths=source_relative
inputs:
- directory: proto/rippleapiVersion Requirements
| Tool | Minimum Version | Edition 2024 Support |
|---|---|---|
| protoc | >= 33.0 | Full support |
| buf CLI | >= 1.64.0 | Expected (v1.63.0 does not support) |
| protoc-gen-go | latest | Full support |
| protoc-gen-go-grpc | latest | Full support |
Version Checks
The Makefile includes automatic version verification:
make protoc-version-check # Check protoc >= 33.0
make buf-version-check # Check buf >= 1.64.0These checks run automatically when using make proto.