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";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.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
|
|
|
}
|
|
|
|
|
2021-11-17 06:37:07 +00:00
|
|
|
// NeoFS subnetwork identifier.
|
|
|
|
//
|
|
|
|
// String representation of a value is base-10 integer.
|
|
|
|
//
|
|
|
|
// JSON representation is an object containing single `value` number field.
|
|
|
|
message SubnetID {
|
|
|
|
// 4-byte integer subnetwork identifier.
|
|
|
|
fixed32 value = 1 [json_name = "value"];
|
|
|
|
}
|
|
|
|
|
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"];
|
2022-03-02 09:30:05 +00:00
|
|
|
// Scheme contains digital signature scheme identifier
|
2022-02-07 12:46:39 +00:00
|
|
|
SignatureScheme scheme = 3 [json_name = "scheme"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Signature scheme describes digital signing scheme used for (key, signature) pair.
|
|
|
|
enum SignatureScheme {
|
2022-03-02 09:30:05 +00:00
|
|
|
// ECDSA with SHA-512 hashing (FIPS 186-3)
|
|
|
|
ECDSA_SHA512 = 0;
|
|
|
|
|
2022-02-07 12:46:39 +00:00
|
|
|
// Deterministic ECDSA with SHA-256 hashing (RFC 6979)
|
2022-03-02 09:30:05 +00:00
|
|
|
ECDSA_RFC6979_SHA256 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RFC 6979 signature.
|
|
|
|
message SignatureRFC6979 {
|
|
|
|
// Public key used for signing
|
|
|
|
bytes key = 1 [json_name = "key"];
|
|
|
|
// Deterministic ECDSA with SHA-256 hashing
|
|
|
|
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
|
|
|
}
|