// Copyright 2022 The Tari Project
// SPDX-License-Identifier: BSD-3-Clause

syntax = "proto3";

package tari.dht;

import "common.proto";

// JoinMessage contains the information required for a network join request.
//
// Message containing contact information for a node wishing to join the network.
// When this message is received the node validates the provided information and,
// if everything checks out, the peer is added to the peer list and the join request
// is propagated to the network.
message JoinMessage {
    bytes public_key =1;
    repeated bytes addresses = 2;
    uint32 peer_features = 3;
    uint64 nonce = 4;
    tari.dht.common.IdentitySignature identity_signature = 5;
}

// The DiscoverMessage stores the information required for a network discover request.
//
// When this message is received and can be decrypted, this node verifies the information
// provided and, if everything checks out, a DiscoveryResponse is sent to the origin of this
// Discovery request so that the source node knows about this node.
message DiscoveryMessage {
    bytes public_key =1;
    repeated bytes addresses = 2;
    uint32 peer_features = 3;
    uint64 nonce = 4;
    tari.dht.common.IdentitySignature identity_signature = 5;
}

message DiscoveryResponseMessage {
    bytes public_key = 1;
    repeated bytes addresses = 2;
    uint32 peer_features = 3;
    uint64 nonce = 4;
    tari.dht.common.IdentitySignature identity_signature = 5;
}
