2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 22:23:57 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.refs;
|
2020-08-05 22:23:57 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs";
|
2020-08-12 21:43:51 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.v2.Refs";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-12-08 15:08:32 +00:00
|
|
|
// Objects in NeoFS are addressed by their ContainerID and ObjectID.
|
|
|
|
//
|
|
|
|
// String presentation of `Address` is the concatenation of string encoded
|
|
|
|
// `ContainerID` and `ObjectID` delimited by '/' character.
|
2020-01-30 11:41:24 +00:00
|
|
|
message Address {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Container identifier
|
2020-10-19 09:30:51 +00:00
|
|
|
ContainerID container_id = 1 [json_name = "containerID"];
|
2020-10-15 20:50:40 +00:00
|
|
|
// Object identifier
|
2020-10-19 09:30:51 +00:00
|
|
|
ObjectID object_id = 2 [json_name = "objectID"];
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
2020-08-04 12:52:14 +00:00
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// NeoFS Object unique identifier. Objects are immutable and content-addressed.
|
2020-12-08 15:08:32 +00:00
|
|
|
// It means `ObjectID` will change if `header` or `payload` changes.
|
|
|
|
//
|
2020-12-14 16:40:12 +00:00
|
|
|
// `ObjectID` is a 32 byte long
|
|
|
|
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
|
|
|
// object's `header` field, which, in it's turn, contains hash of object's
|
|
|
|
// payload.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
2020-12-14 16:40:12 +00:00
|
|
|
// String presentation is
|
|
|
|
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
|
|
|
//
|
|
|
|
// JSON value will be the data encoded as a string using standard base64
|
|
|
|
// encoding with paddings. Either
|
|
|
|
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
|
|
|
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
|
|
|
// with/without paddings are accepted.
|
2020-08-04 12:52:14 +00:00
|
|
|
message ObjectID {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Object identifier in a binary format
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes value = 1 [json_name = "value"];
|
2020-08-05 14:39:57 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// NeoFS container identifier. Container structures are immutable and
|
2020-12-08 15:08:32 +00:00
|
|
|
// content-addressed.
|
|
|
|
//
|
2020-12-14 16:40:12 +00:00
|
|
|
// `ContainerID` is a 32 byte long
|
|
|
|
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
|
|
|
// stable-marshalled container message.
|
|
|
|
//
|
|
|
|
// String presentation is
|
|
|
|
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
2020-12-14 16:40:12 +00:00
|
|
|
// JSON value will be the data encoded as a string using standard base64
|
|
|
|
// encoding with paddings. Either
|
|
|
|
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
|
|
|
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
|
|
|
// with/without paddings are accepted.
|
2020-08-05 14:39:57 +00:00
|
|
|
message ContainerID {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Container identifier in a binary format.
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes value = 1 [json_name = "value"];
|
2020-08-05 14:39:57 +00:00
|
|
|
}
|
2020-08-05 15:11:00 +00:00
|
|
|
|
2020-12-08 15:08:32 +00:00
|
|
|
// `OwnerID` is a derivative of a user's main public key. The transformation
|
2020-10-15 20:50:40 +00:00
|
|
|
// algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can
|
|
|
|
// be directly used as `OwnerID`.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
|
|
|
// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte
|
|
|
|
// followed by 20 bytes of ScrptHash and 4 bytes of checksum.
|
|
|
|
//
|
2020-12-14 16:40:12 +00:00
|
|
|
// String presentation is [Base58
|
|
|
|
// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string.
|
|
|
|
//
|
|
|
|
// JSON value will be the data encoded as a string using standard base64
|
|
|
|
// encoding with paddings. Either
|
|
|
|
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
|
|
|
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
|
|
|
// with/without paddings are accepted.
|
2020-08-05 15:11:00 +00:00
|
|
|
message OwnerID {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Identifier of the container owner in a binary format
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes value = 1 [json_name = "value"];
|
2020-08-18 13:14:25 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// API version used by a node.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
|
|
|
// String presentation is a Semantic Versioning 2.0.0 compatible version string
|
|
|
|
// with 'v' prefix. I.e. `vX.Y`, where `X` - major number, `Y` - minor number.
|
2020-08-18 13:14:25 +00:00
|
|
|
message Version {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Major API version
|
2020-10-16 13:17:49 +00:00
|
|
|
uint32 major = 1 [json_name = "major"];
|
2020-08-18 13:14:25 +00:00
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// Minor API version
|
2020-10-16 13:17:49 +00:00
|
|
|
uint32 minor = 2 [json_name = "minor"];
|
2020-08-18 13:14:25 +00:00
|
|
|
}
|
2020-08-18 13:41:47 +00:00
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// Signature of something in NeoFS.
|
2020-08-18 13:41:47 +00:00
|
|
|
message Signature {
|
2020-10-15 20:50:40 +00:00
|
|
|
// Public key used for signing
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes key = 1 [json_name = "key"];
|
2020-08-18 13:41:47 +00:00
|
|
|
// Signature
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes sign = 2 [json_name = "signature"];
|
2020-08-18 13:41:47 +00:00
|
|
|
}
|
2020-08-18 15:26:51 +00:00
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// Checksum algorithm type.
|
2020-08-18 15:26:51 +00:00
|
|
|
enum ChecksumType {
|
|
|
|
// Unknown. Not used
|
|
|
|
CHECKSUM_TYPE_UNSPECIFIED = 0;
|
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// Tillich-Zemor homomorphic hash function
|
2020-08-18 15:26:51 +00:00
|
|
|
TZ = 1;
|
|
|
|
|
|
|
|
// SHA-256
|
|
|
|
SHA256 = 2;
|
|
|
|
}
|
|
|
|
|
2020-10-15 20:50:40 +00:00
|
|
|
// Checksum message.
|
2020-12-08 15:08:32 +00:00
|
|
|
// Depending on checksum algorithm type the string presentation may vary:
|
|
|
|
//
|
|
|
|
// * TZ \
|
|
|
|
// Hex encoded string without `0x` prefix
|
|
|
|
// * SHA256 \
|
|
|
|
// Hex encoded string without `0x` prefix
|
2020-08-18 15:26:51 +00:00
|
|
|
message Checksum {
|
2020-08-18 15:41:25 +00:00
|
|
|
// Checksum algorithm type
|
2020-10-16 13:17:49 +00:00
|
|
|
ChecksumType type = 1 [json_name = "type"];
|
2020-08-18 15:41:25 +00:00
|
|
|
|
|
|
|
// Checksum itself
|
2020-10-16 13:17:49 +00:00
|
|
|
bytes sum = 2 [json_name = "sum"];
|
2020-08-18 15:26:51 +00:00
|
|
|
}
|