/**
 * # Chain of Trust Proof
 * Proof that some data belongs to the network's chain of trust, starting from
 * the genesis network whose address book hash formed the ledger id. (In the
 * current system, this data is always a hinTS verification key.)
 *
 * ### Keywords
 * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
 * document are to be interpreted as described in
 * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in
 * [RFC8174](https://www.ietf.org/rfc/rfc8174).
 */
syntax = "proto3";

package com.hedera.hapi.block.stream;

// SPDX-License-Identifier: Apache-2.0
option java_package = "com.hedera.hapi.block.stream.protoc";
// <<<pbj.java_package = "com.hedera.hapi.block.stream">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

message ChainOfTrustProof {
    oneof proof {
        /**
         * If there is not yet a SNARK proving the chain of trust from ledger id to
         * the hinTS verification key, the explicit list of Schnorr signatures on
         * the concatenation of the ledger id and genesis hinTS verification key
         * that serve as witnesses for the SNARK prover algorithm.
         */
        NodeSignatures node_signatures = 1;
        /**
         * If known, a ZK-compressed SNARK proof proving the chain of trust from
         * the ledger id to this hinTS verification key.
         */
        bytes wraps_proof = 2;
    }
}

/**
 * A list of valid node signatures on some data assumed known from the context
 * of the message, ordered by node id.
 * <p>
 * Can be used to prove the genesis hinTS verification key in a block proof; but
 * not succinct and not recursive; hence in normal operations with TSS, used only
 * until the first recursive proof is available.
 */
message NodeSignatures {
    repeated NodeSignature node_signatures = 1;
}

/**
 * A signature from a node on some data assumed known from the context of the
 * message.
 */
message NodeSignature {
    /**
     * The node id of the signer.
     */
    uint64 node_id = 1;
    /**
     * The signature.
     */
    bytes signature = 2;
}
