From b9ff9201444b29642aeadad3ce5548639332b878 Mon Sep 17 00:00:00 2001 From: Arvid Lunnemark Date: Thu, 23 Jun 2022 18:01:18 -0700 Subject: [PATCH] add identifier.proto --- schema/identifier.proto | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 schema/identifier.proto diff --git a/schema/identifier.proto b/schema/identifier.proto new file mode 100644 index 0000000..be4609b --- /dev/null +++ b/schema/identifier.proto @@ -0,0 +1,38 @@ +// +// Copyright 2022 Anysphere, Inc. +// SPDX-License-Identifier: GPL-3.0-only +// + +/* +identifier.proto contains the protobuf for the public identifier. +this schema should be kept backwards-compatible at all costs. +*/ + +syntax = "proto3"; + +package asphrclient; + +// We want the identifier to contain as little information as possible, but still +// enough such that it can be used both for the one-way asynchronous friend adding method (which requires +// a public-key crypto public key) as well as the two-way friend adding method (which requires +// a key-exchange public key). We also include the index allocation. +// +// The string-based public ID takes the following format: +// +// [public-id] = base58(bytes(PublicID) || checksum(bytes(PublicID))) +// +// In public, it is always displayed in link format: +// +// [public-id-link] = anysphere.id/#[public-id] +// +message PublicID { + // index is the database index of the person. + // if, in the future, a person has access to several indices, this is the index that is used + // in the friend-adding process. two people who can already communicate may tell each other about + // other indices. this is just for bootstrapping. + uint32 index = 1; + // the public-key crypto public key, used for handling friend requests. + bytes friend_request_public_key = 2; + // the key-exchange public key, used for adding a friend in the two-way situation. + bytes kx_public_key = 3; +} \ No newline at end of file