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
|
|
|
|
2023-03-07 08:50:02 +00:00
|
|
|
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-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.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// String presentation of `Address` is a concatenation of string encoded
|
2020-12-08 15:08:32 +00:00
|
|
|
// `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.
|
2022-04-13 06:21:33 +00:00
|
|
|
// It means `ObjectID` will change if the `header` or the `payload` changes.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
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
|
2022-04-13 06:21:33 +00:00
|
|
|
// the object's `header` field, which, in it's turn, contains the hash of the object's
|
2020-12-14 16:40:12 +00:00
|
|
|
// payload.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// String presentation is a
|
2020-12-14 16:40:12 +00:00
|
|
|
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// JSON value will be data encoded as a string using standard base64
|
2020-12-14 16:40:12 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// String presentation is a
|
2020-12-14 16:40:12 +00:00
|
|
|
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// JSON value will be data encoded as a string using standard base64
|
2020-12-14 16:40:12 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// String presentation is a [Base58
|
2020-12-14 16:40:12 +00:00
|
|
|
// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// JSON value will be data encoded as a string using standard base64
|
2020-12-14 16:40:12 +00:00
|
|
|
// 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.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// JSON representation is an object containing a single `value` number field.
|
2021-11-17 06:37:07 +00:00
|
|
|
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
|
2022-04-13 06:21:33 +00:00
|
|
|
// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the 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;
|
2022-03-15 12:49:35 +00:00
|
|
|
|
|
|
|
// Deterministic ECDSA with SHA-256 hashing using WalletConnect API.
|
|
|
|
// Here the algorithm is the same, but the message format differs.
|
|
|
|
ECDSA_RFC6979_SHA256_WALLET_CONNECT = 2;
|
2022-03-02 09:30:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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.
|
2022-04-13 06:21:33 +00:00
|
|
|
// Depending on checksum algorithm type, the string presentation may vary:
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
|
|
|
// * 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
|
|
|
}
|