All Downloads are FREE. Search and download functionalities are using the official Maven repository.

state.consensus.topic.proto Maven / Gradle / Ivy

There is a newer version: 0.54.0
Show newest version
syntax = "proto3";

package proto;

/*-
 * ‌
 * Hedera Network Services Protobuf
 * ​
 * Copyright (C) 2018 - 2023 Hedera Hashgraph, LLC
 * ​
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ‍
 */

import "basic_types.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

/**
 * Representation of a Hedera Consensus Service topic in the network Merkle tree.
 * 
 * As with all network entities, a topic has a unique entity number, which is usually given along 
 * with the network's shard and realm in the form of a shard.realm.number id.
 * 
 * A topic consists of just two pieces of data:
 *   1. The total number of messages sent to the topic; and,
 *   2. The running hash of all those messages.
 * It also has several metadata elements:
 *   1. A consensus expiration time in seconds since the epoch.
 *   2. (Optional) The number of an auto-renew account, in the same shard and realm as the topic, that 
 *   has signed a transaction allowing the network to use its balance to automatically extend the topic's 
 *   expiration time when it passes.
 *   3. The number of seconds the network should automatically extend the topic's expiration by, if the 
 *   topic has a valid auto-renew account, and is not deleted upon expiration.
 *   4. A boolean marking if the topic has been deleted.
 *   5. A memo string whose UTF-8 encoding is at most 100 bytes.
 *   6. (Optional) An admin key whose signature must be active for the topic's metadata to be updated.
 *   7. (Optional) A submit key whose signature must be active for the topic to receive a message.
 */
message Topic {
    /**
     * The topic's unique id in the Merkle state.
     */
    TopicID topic_id = 1;
    /**
     * The number of messages sent to the topic.
     */
    int64 sequence_number = 2;
    /**
     * The topic's consensus expiration time in seconds since the epoch.
     */
    int64 expiration_second = 3;
    /**
     * The number of seconds for which the topic will be automatically renewed 
     * upon expiring (if it has a valid auto-renew account).
     */
    int64 auto_renew_period = 4;
    /**
     * The id of the account (if any) that the network will attempt to charge for the
     * topic's auto-renewal upon expiration.
     */
    AccountID auto_renew_account_id = 5;
    /**
     * Whether this topic is deleted.
     */
    bool deleted = 6;
    /**
     * When a topic is created, its running hash is initialized to 48 bytes of binary zeros.
     * For each submitted message, the topic's running hash is then updated to the output
     * of a particular SHA-384 digest whose input data include the previous running hash.
     * 
     * See the TransactionReceipt.proto documentation for an exact description of the
     * data included in the SHA-384 digest used for the update.
     */
    bytes running_hash = 7;
    /**
     * An optional description of the topic with UTF-8 encoding up to 100 bytes.
     */
    string memo = 8;
    /**
     * If present, enforces access control for updating or deleting the topic.
     * A topic without an admin key is immutable.
     */
    Key admin_key = 9;
    /**
     * If present, enforces access control for message submission to the topic.
     */
    Key submit_key = 10;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy