109 lines
2.4 KiB
Protocol Buffer
109 lines
2.4 KiB
Protocol Buffer
// nockchain/common/v1/primitives.proto
|
|
|
|
syntax = "proto3";
|
|
|
|
package nockchain.public.v1;
|
|
option go_package = "./;nockchain";
|
|
|
|
message ErrorStatus {
|
|
ErrorCode code = 1;
|
|
string message = 2;
|
|
optional string details = 3; // additional error context
|
|
}
|
|
|
|
message Acknowledged {}
|
|
|
|
enum ErrorCode {
|
|
ERROR_CODE_UNSPECIFIED = 0;
|
|
ERROR_CODE_INVALID_REQUEST = 1;
|
|
ERROR_CODE_PEEK_FAILED = 2;
|
|
ERROR_CODE_PEEK_RETURNED_NO_DATA = 3;
|
|
ERROR_CODE_POKE_FAILED = 4;
|
|
ERROR_CODE_NACKAPP_ERROR = 5;
|
|
ERROR_CODE_TIMEOUT = 6;
|
|
ERROR_CODE_INTERNAL_ERROR = 7;
|
|
ERROR_CODE_NOT_FOUND = 8;
|
|
ERROR_CODE_PERMISSION_DENIED = 9;
|
|
ERROR_CODE_INVALID_WIRE = 10;
|
|
ERROR_CODE_KERNEL_ERROR = 11;
|
|
}
|
|
|
|
// ===================================================================
|
|
// Wire types for NockApp pokes
|
|
// ===================================================================
|
|
|
|
message Wire {
|
|
string source = 1; // e.g., "http", "file", "wallet", "grpc"
|
|
uint64 version = 2; // wire format version
|
|
repeated WireTag tags = 3; // operation-specific tags
|
|
}
|
|
|
|
message WireTag {
|
|
oneof value {
|
|
string text = 1;
|
|
uint64 number = 2;
|
|
}
|
|
}
|
|
|
|
// Note: prefer using raw numeric fields in messages
|
|
// instead of these wrappers to simplify conversions.
|
|
// These remain defined for potential future use.
|
|
message NoteVersion { uint32 value = 1; }
|
|
message BlockHeight { uint64 value = 1; }
|
|
message BlockHeightDelta { uint64 value = 1; }
|
|
message Nicks { uint64 value = 1; }
|
|
|
|
// pub chal: [Belt; 8],
|
|
// pub sig: [Belt; 8],
|
|
message EightBelt {
|
|
Belt belt_1 = 1;
|
|
Belt belt_2 = 2;
|
|
Belt belt_3 = 3;
|
|
Belt belt_4 = 4;
|
|
Belt belt_5 = 5;
|
|
Belt belt_6 = 6;
|
|
Belt belt_7 = 7;
|
|
Belt belt_8 = 8;
|
|
}
|
|
|
|
// pub struct Hash(pub [Belt; 5]);
|
|
// Use fixed fields to avoid variable-length vectors.
|
|
message Hash {
|
|
Belt belt_1 = 1;
|
|
Belt belt_2 = 2;
|
|
Belt belt_3 = 3;
|
|
Belt belt_4 = 4;
|
|
Belt belt_5 = 5;
|
|
}
|
|
|
|
message Base58Hash {
|
|
string hash = 1;
|
|
}
|
|
|
|
// pub struct SchnorrPubkey(pub CheetahPoint);
|
|
message SchnorrPubkey { CheetahPoint value = 1; }
|
|
|
|
// pub struct CheetahPoint {
|
|
// pub x: F6lt,
|
|
// pub y: F6lt,
|
|
// pub inf: bool,
|
|
// }
|
|
message CheetahPoint {
|
|
SixBelt x = 1;
|
|
SixBelt y = 2;
|
|
bool inf = 3;
|
|
}
|
|
|
|
// pub struct F6lt(pub [Belt; 6]);
|
|
message SixBelt {
|
|
Belt belt_1 = 1;
|
|
Belt belt_2 = 2;
|
|
Belt belt_3 = 3;
|
|
Belt belt_4 = 4;
|
|
Belt belt_5 = 5;
|
|
Belt belt_6 = 6;
|
|
}
|
|
|
|
// pub struct Belt(pub u64);
|
|
message Belt { uint64 value = 1; }
|