Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal protobuf support for the BLS protocol #117

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions services/bls_protocol_type.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
syntax = "proto3";

package proto;

/*-
* ‌
* Hedera Network Services Protobuf
* ​
* Copyright (C) 2018 - 2021 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.hederahashgraph.api.proto.java";
option java_multiple_files = true;

/**
* The types of BLS protocols that may be initiated.
*/
enum BlsProtocolType {
/**
* An (invalid) default value for this enum, to ensure the client explicitly sets
* the intended type of BLS protocol to initiate.
*/
UNKNOWN = 0;

/**
* Initiates the genesis protocol to first, derive the common reference string (CRS);
* and second, invoke the distributed key generation.
*
* Note that the second stage occurs only if the first succeeds; the status of
* each stage may be requested using the network service getBlsProtocolStatus query.
*/
GENESIS = 1;

/**
* Initiates the protocol to compute a resharing of the distributed private key.
*/
REKEY = 2;
}
44 changes: 44 additions & 0 deletions services/initiate_bls_protocol.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";

package proto;

/*-
* ‌
* Hedera Network Services Protobuf
* ​
* Copyright (C) 2018 - 2021 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.hederahashgraph.api.proto.java";
option java_multiple_files = true;

import "duration.proto";

/**
* Initiates a given type BLS protocol. Transaction payer must have superuser privileges
* (account 0.0.2 or 0.0.50).
*/
message InitiateBlsProtocolBody {
/**
* The choice of BLS protocol type to initiate.
*/
BlsProtocolType bls_protocol_type = 1;

/**
* The maximum time allowed for each protocol stage.
*/
Duration phase_duration = 2;
}
6 changes: 6 additions & 0 deletions services/network_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ service NetworkService {
*/
rpc getExecutionTime (Query) returns (Response);

/**
* Initiates a given stage of the BLS protocol. Transaction payer must have superuser
* privileges (account 0.0.2 or 0.0.50).
*/
rpc initiateBlsProtocol (Transaction) returns (TransactionResponse);

/**
* Submits a "wrapped" transaction to the network, skipping its standard prechecks. (Note that
* the "wrapper" <tt>UncheckedSubmit</tt> transaction is still subject to normal prechecks,
Expand Down
5 changes: 5 additions & 0 deletions services/response_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1093,4 +1093,9 @@ enum ResponseCodeEnum {
* consensus level.
*/
CONSENSUS_GAS_EXHAUSTED = 279;

/**
* The provided BLS phase duration was not adequate for the protocol.
*/
INSUFFICIENT_BLS_PHASE_DURATION = 280;
}
5 changes: 5 additions & 0 deletions services/transaction_body.proto
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,10 @@ message TransactionBody {
* Adds one or more Ed25519 keys to the affirmed signers of a scheduled transaction
*/
ScheduleSignTransactionBody scheduleSign = 44;

/**
* Initiates a given type BLS protocol
*/
InitiateBlsProtocolBody initiateBlsProtocol = 45;
}
}