-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Block Signing protobufs (#16426)
Signed-off-by: Neeharika-Sompalli <[email protected]> Signed-off-by: Neeharika Sompalli <[email protected]> Co-authored-by: Joseph S. <[email protected]>
- Loading branch information
1 parent
8c66412
commit 3596523
Showing
16 changed files
with
211 additions
and
18 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
hapi/hedera-protobufs/services/auxiliary/tss/tss_share_signature.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* # Tss Share Signature | ||
* Represents a transaction that submits a node's share signature on a block hash | ||
* during the TSS (Threshold Signature Scheme) process. | ||
* | ||
* ### 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.services.auxiliary.tss; | ||
|
||
/* | ||
* Copyright (C) 2024 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. | ||
*/ | ||
|
||
option java_package = "com.hedera.hapi.services.auxiliary.tss.legacy"; | ||
// <<<pbj.java_package = "com.hedera.hapi.services.auxiliary.tss">>> This comment is special code for setting PBJ Compiler java package | ||
option java_multiple_files = true; | ||
|
||
/** | ||
* A TSS Share Signature transaction Body.<br/> | ||
* This transaction body communicates a node's signature of a block hash | ||
* using its private share within the TSS process. | ||
* This transaction MUST be prioritized for low latency gossip transmission. | ||
* | ||
* ### Block Stream Effects | ||
* This transaction body will be present in the block stream. This will not have | ||
* any state changes or transaction output or transaction result. | ||
*/ | ||
message TssShareSignatureTransactionBody { | ||
/** | ||
* A SHA2-384 Hash.<br/> | ||
* This is the hash of the roster that includes the node whose | ||
* share produced this share signature. | ||
* <p> | ||
* This value is REQUIRED.<br/> | ||
* This value MUST identify the network roster active at the time this | ||
* share signature was produced.<br/> | ||
* This share signature MUST be produced from a share distributed during | ||
* the re-keying process for the identified roster. | ||
*/ | ||
bytes roster_hash = 1; | ||
|
||
/** | ||
* An index of the share from the node private shares.<br/> | ||
* This is the index of the share that produced this share signature. | ||
* <p> | ||
* This value is REQUIRED.<br/> | ||
* The share referred to by this index MUST exist.<br/> | ||
* The share index MUST be greater than or equal to 0. | ||
*/ | ||
uint64 share_index = 2; | ||
|
||
/** | ||
* A SHA2-384 hash.<br/> | ||
* This is the hash of the message that was signed. | ||
* <p> | ||
* This value is REQUIRED.<br/> | ||
* The message signed MUST be a block hash. | ||
*/ | ||
bytes message_hash = 3; | ||
|
||
/** | ||
* The signature bytes.<br/> | ||
* This is the signature generated by signing the block hash with the node's private share. | ||
* <p> | ||
* This value is REQUIRED.<br/> | ||
* This value MUST be a valid signature of the message hash with the node's private share. | ||
*/ | ||
bytes share_signature = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...e/hedera-app/src/main/java/com/hedera/node/app/tss/handlers/TssShareSignatureHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) 2024 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. | ||
*/ | ||
|
||
package com.hedera.node.app.tss.handlers; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import com.hedera.hapi.node.transaction.TransactionBody; | ||
import com.hedera.node.app.spi.workflows.HandleContext; | ||
import com.hedera.node.app.spi.workflows.HandleException; | ||
import com.hedera.node.app.spi.workflows.PreCheckException; | ||
import com.hedera.node.app.spi.workflows.PreHandleContext; | ||
import com.hedera.node.app.spi.workflows.TransactionHandler; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
/** | ||
* Handles TSS share signature transactions. | ||
* This is yet to be implemented. | ||
*/ | ||
@Singleton | ||
public class TssShareSignatureHandler implements TransactionHandler { | ||
|
||
@Inject | ||
public TssShareSignatureHandler() {} | ||
|
||
@Override | ||
public void preHandle(@NonNull final PreHandleContext context) throws PreCheckException { | ||
requireNonNull(context); | ||
// TODO: Implement this in the later PRS | ||
} | ||
|
||
@Override | ||
public void pureChecks(@NonNull final TransactionBody txn) throws PreCheckException { | ||
requireNonNull(txn); | ||
} | ||
|
||
@Override | ||
public void handle(@NonNull final HandleContext context) throws HandleException { | ||
requireNonNull(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters