diff --git a/api/api.proto b/api/api.proto
index b62f6cdd1..945fc7730 100644
--- a/api/api.proto
+++ b/api/api.proto
@@ -2,9 +2,17 @@ syntax = "proto3";
package protocol;
import "core/Tron.proto";
-import "core/Contract.proto";
import "google/api/annotations.proto";
+import "core/contract/asset_issue_contract.proto";
+import "core/contract/account_contract.proto";
+import "core/contract/witness_contract.proto";
+import "core/contract/balance_contract.proto";
+import "core/contract/proposal_contract.proto";
+import "core/contract/storage_contract.proto";
+import "core/contract/exchange_contract.proto";
+import "core/contract/smart_contract.proto";
+import "core/contract/shield_contract.proto";
option java_package = "org.tron.api"; //Specify the name of the package that generated the Java file
option java_outer_classname = "GrpcAPI"; //Specify the class name of the generated Java file
@@ -630,6 +638,16 @@ service Wallet {
rpc GetNodeInfo (EmptyMessage) returns (NodeInfo) {
};
+ rpc GetRewardInfo (BytesMessage) returns (NumberMessage) {
+ };
+
+ rpc GetBrokerageInfo (BytesMessage) returns (NumberMessage) {
+ };
+
+ rpc UpdateBrokerage (UpdateBrokerageContract) returns (TransactionExtention) {
+
+ };
+
// for shiededTransaction
rpc CreateShieldedTransaction (PrivateParameters) returns (TransactionExtention) {
};
@@ -689,14 +707,11 @@ service Wallet {
};
// end for shiededTransaction
- rpc GetRewardInfo (BytesMessage) returns (NumberMessage) {
- };
-
- rpc GetBrokerageInfo (BytesMessage) returns (NumberMessage) {
+ rpc CreateCommonTransaction (Transaction) returns (TransactionExtention) {
};
- rpc UpdateBrokerage (UpdateBrokerageContract) returns (TransactionExtention) {
- };
+ rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) {
+ }
};
service WalletSolidity {
@@ -829,7 +844,6 @@ service WalletSolidity {
};
}
-
rpc GetMerkleTreeVoucherInfo (OutputPointInfo) returns (IncrementalMerkleVoucherInfo) {
}
@@ -845,15 +859,18 @@ service WalletSolidity {
rpc IsSpend (NoteParameters) returns (SpendResult) {
}
- rpc TriggerConstantContract (TriggerSmartContract) returns (TransactionExtention) {
- }
-
rpc GetRewardInfo (BytesMessage) returns (NumberMessage) {
};
rpc GetBrokerageInfo (BytesMessage) returns (NumberMessage) {
};
+ rpc TriggerConstantContract (TriggerSmartContract) returns (TransactionExtention) {
+ }
+
+ rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) {
+ }
+
};
service WalletExtension {
@@ -1291,3 +1308,7 @@ message SpendResult {
bool result = 1;
string message = 2;
}
+
+message TransactionInfoList {
+ repeated TransactionInfo transactionInfo = 1;
+}
diff --git a/api/zksnark.proto b/api/zksnark.proto
index 66538d6ad..91b985651 100644
--- a/api/zksnark.proto
+++ b/api/zksnark.proto
@@ -2,7 +2,6 @@ syntax = "proto3";
package protocol;
import "core/Tron.proto";
-import "core/Contract.proto";
option java_package = "org.tron.api"; //Specify the name of the package that generated the Java file
option java_outer_classname = "ZksnarkGrpcAPI"; //Specify the class name of the generated Java file
diff --git a/core/Contract.proto b/core/Contract.proto
deleted file mode 100644
index aa33cfe33..000000000
--- a/core/Contract.proto
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * java-tron is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * java-tron is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-syntax = "proto3";
-
-package protocol;
-
-option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
-option java_outer_classname = "Contract"; //Specify the class name of the generated Java file
-option go_package = "github.com/tronprotocol/grpc-gateway/core";
-
-import "core/Tron.proto";
-
-message AccountCreateContract {
- bytes owner_address = 1;
- bytes account_address = 2;
- AccountType type = 3;
-}
-
-// Update account name. Account name is not unique now.
-message AccountUpdateContract {
- bytes account_name = 1;
- bytes owner_address = 2;
-}
-
-// Set account id if the account has no id. Account id is unique and case insensitive.
-message SetAccountIdContract {
- bytes account_id = 1;
- bytes owner_address = 2;
-}
-
-message TransferContract {
- bytes owner_address = 1;
- bytes to_address = 2;
- int64 amount = 3;
-}
-
-
-message ShieldAddress {
- bytes private_address = 1;
- bytes public_address = 2;
-}
-
-message TransferAssetContract {
- // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME's activation,
- // otherwise it is token id and token should be in string format.
- bytes asset_name = 1;
- bytes owner_address = 2;
- bytes to_address = 3;
- int64 amount = 4;
-}
-
-
-message VoteAssetContract {
- bytes owner_address = 1;
- repeated bytes vote_address = 2;
- bool support = 3;
- int32 count = 5;
-}
-
-message VoteWitnessContract {
- message Vote {
- bytes vote_address = 1;
- int64 vote_count = 2;
- }
- bytes owner_address = 1;
- repeated Vote votes = 2;
- bool support = 3;
-}
-
-message UpdateSettingContract {
- bytes owner_address = 1;
- bytes contract_address = 2;
- int64 consume_user_resource_percent = 3;
-}
-
-message UpdateEnergyLimitContract {
- bytes owner_address = 1;
- bytes contract_address = 2;
- int64 origin_energy_limit = 3;
-}
-
-message ClearABIContract {
- bytes owner_address = 1;
- bytes contract_address = 2;
-}
-
-message WitnessCreateContract {
- bytes owner_address = 1;
- bytes url = 2;
-}
-
-message WitnessUpdateContract {
- bytes owner_address = 1;
- bytes update_url = 12;
-}
-
-message AssetIssueContract {
- string id = 41;
-
- message FrozenSupply {
- int64 frozen_amount = 1;
- int64 frozen_days = 2;
- }
- bytes owner_address = 1;
- bytes name = 2;
- bytes abbr = 3;
- int64 total_supply = 4;
- repeated FrozenSupply frozen_supply = 5;
- int32 trx_num = 6;
- int32 precision = 7;
- int32 num = 8;
- int64 start_time = 9;
- int64 end_time = 10;
- int64 order = 11; // useless
- int32 vote_score = 16;
- bytes description = 20;
- bytes url = 21;
- int64 free_asset_net_limit = 22;
- int64 public_free_asset_net_limit = 23;
- int64 public_free_asset_net_usage = 24;
- int64 public_latest_free_net_time = 25;
-}
-
-message ParticipateAssetIssueContract {
- bytes owner_address = 1;
- bytes to_address = 2;
- // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME's activation,
- // otherwise it is token id and token should be in string format.
- bytes asset_name = 3;
- int64 amount = 4; // the amount of drops
-}
-
-
-enum ResourceCode {
- BANDWIDTH = 0x00;
- ENERGY = 0x01;
-}
-
-message FreezeBalanceContract {
- bytes owner_address = 1;
- int64 frozen_balance = 2;
- int64 frozen_duration = 3;
-
- ResourceCode resource = 10;
- bytes receiver_address = 15;
-}
-
-message UnfreezeBalanceContract {
- bytes owner_address = 1;
-
- ResourceCode resource = 10;
- bytes receiver_address = 15;
-}
-
-message UnfreezeAssetContract {
- bytes owner_address = 1;
-}
-
-message WithdrawBalanceContract {
- bytes owner_address = 1;
-}
-
-message UpdateAssetContract {
- bytes owner_address = 1;
- bytes description = 2;
- bytes url = 3;
- int64 new_limit = 4;
- int64 new_public_limit = 5;
-}
-
-message ProposalCreateContract {
- bytes owner_address = 1;
- map parameters = 2;
-}
-
-message ProposalApproveContract {
- bytes owner_address = 1;
- int64 proposal_id = 2;
- bool is_add_approval = 3; // add or remove approval
-}
-
-message ProposalDeleteContract {
- bytes owner_address = 1;
- int64 proposal_id = 2;
-}
-
-message CreateSmartContract {
- bytes owner_address = 1;
- SmartContract new_contract = 2;
- int64 call_token_value = 3;
- int64 token_id = 4;
-}
-
-message TriggerSmartContract {
- bytes owner_address = 1;
- bytes contract_address = 2;
- int64 call_value = 3;
- bytes data = 4;
- int64 call_token_value = 5;
- int64 token_id = 6;
-}
-
-message BuyStorageContract {
- bytes owner_address = 1;
- int64 quant = 2; // trx quantity for buy storage (in sun)
-}
-
-message BuyStorageBytesContract {
- bytes owner_address = 1;
- int64 bytes = 2; // storage bytes for buy
-}
-
-message SellStorageContract {
- bytes owner_address = 1;
- int64 storage_bytes = 2;
-}
-
-message ExchangeCreateContract {
- bytes owner_address = 1;
- bytes first_token_id = 2;
- int64 first_token_balance = 3;
- bytes second_token_id = 4;
- int64 second_token_balance = 5;
-}
-
-message ExchangeInjectContract {
- bytes owner_address = 1;
- int64 exchange_id = 2;
- bytes token_id = 3;
- int64 quant = 4;
-}
-
-message ExchangeWithdrawContract {
- bytes owner_address = 1;
- int64 exchange_id = 2;
- bytes token_id = 3;
- int64 quant = 4;
-}
-
-message ExchangeTransactionContract {
- bytes owner_address = 1;
- int64 exchange_id = 2;
- bytes token_id = 3;
- int64 quant = 4;
- int64 expected = 5;
-}
-
-message AccountPermissionUpdateContract {
- bytes owner_address = 1;
- Permission owner = 2; // Empty means invalidate
- Permission witness = 3; // Can be empty
- repeated Permission actives = 4; // Empty means invalidate
-}
-
-// for shielded transaction
-message AuthenticationPath {
- repeated bool value = 1;
-}
-
-message MerklePath {
- repeated AuthenticationPath authentication_paths = 1;
- repeated bool index = 2;
- bytes rt = 3;
-}
-
-message OutputPoint {
- bytes hash = 1;
- int32 index = 2;
-}
-
-message OutputPointInfo {
- repeated OutputPoint out_points = 1;
- int32 block_num = 2;
-}
-
-message PedersenHash {
- bytes content = 1;
-}
-
-message IncrementalMerkleTree {
- PedersenHash left = 1;
- PedersenHash right = 2;
- repeated PedersenHash parents = 3;
-}
-
-message IncrementalMerkleVoucher {
- IncrementalMerkleTree tree = 1;
- repeated PedersenHash filled = 2;
- IncrementalMerkleTree cursor = 3;
- int64 cursor_depth = 4;
- bytes rt = 5;
- OutputPoint output_point = 10;
-}
-
-message IncrementalMerkleVoucherInfo {
- repeated IncrementalMerkleVoucher vouchers = 1;
- repeated bytes paths = 2;
-}
-
-message SpendDescription {
- bytes value_commitment = 1;
- bytes anchor = 2; // merkle root
- bytes nullifier = 3; // used for check double spend
- bytes rk = 4; // used for check spend authority signature
- bytes zkproof = 5;
- bytes spend_authority_signature = 6;
-}
-
-message ReceiveDescription {
- bytes value_commitment = 1;
- bytes note_commitment = 2;
- bytes epk = 3; // for Encryption
- bytes c_enc = 4; // Encryption for incoming, decrypt it with ivk
- bytes c_out = 5; // Encryption for audit, decrypt it with ovk
- bytes zkproof = 6;
-}
-
-message ShieldedTransferContract {
- bytes transparent_from_address = 1; // transparent address
- int64 from_amount = 2;
- repeated SpendDescription spend_description = 3;
- repeated ReceiveDescription receive_description = 4;
- bytes binding_signature = 5;
- bytes transparent_to_address = 6; // transparent address
- int64 to_amount = 7; // the amount to transparent to_address
-}
-// end shielded transaction
-
-message UpdateBrokerageContract {
- bytes owner_address = 1;
- int32 brokerage = 2; // 1 mean 1%
-}
-
diff --git a/core/Tron.proto b/core/Tron.proto
index db1355863..d794d3083 100644
--- a/core/Tron.proto
+++ b/core/Tron.proto
@@ -259,9 +259,6 @@ message Transaction {
ProposalDeleteContract = 18;
SetAccountIdContract = 19;
CustomContract = 20;
- // BuyStorageContract = 21;
- // BuyStorageBytesContract = 22;
- // SellStorageContract = 23;
CreateSmartContract = 30;
TriggerSmartContract = 31;
GetContract = 32;
@@ -325,9 +322,9 @@ message Transaction {
bytes ref_block_hash = 4;
int64 expiration = 8;
repeated authority auths = 9;
- // transaction note
+ // data not used
bytes data = 10;
- //only support size = 1, repeated list here for extension
+ //only support size = 1, repeated list here for extension
repeated Contract contract = 11;
// scripts not used
bytes scripts = 12;
@@ -336,7 +333,7 @@ message Transaction {
}
raw raw_data = 1;
- // only support size = 1, repeated list here for muti-sig extension
+ // only support size = 1, repeated list here for muti-sig extension
repeated bytes signature = 2;
repeated Result ret = 5;
}
@@ -509,53 +506,6 @@ message HelloMessage {
BlockId headBlockId = 6;
}
-message SmartContract {
- message ABI {
- message Entry {
- enum EntryType {
- UnknownEntryType = 0;
- Constructor = 1;
- Function = 2;
- Event = 3;
- Fallback = 4;
- }
- message Param {
- bool indexed = 1;
- string name = 2;
- string type = 3;
- // SolidityType type = 3;
- }
- enum StateMutabilityType {
- UnknownMutabilityType = 0;
- Pure = 1;
- View = 2;
- Nonpayable = 3;
- Payable = 4;
- }
-
- bool anonymous = 1;
- bool constant = 2;
- string name = 3;
- repeated Param inputs = 4;
- repeated Param outputs = 5;
- EntryType type = 6;
- bool payable = 7;
- StateMutabilityType stateMutability = 8;
- }
- repeated Entry entrys = 1;
- }
- bytes origin_address = 1;
- bytes contract_address = 2;
- ABI abi = 3;
- bytes bytecode = 4;
- int64 call_value = 5;
- int64 consume_user_resource_percent = 6;
- string name = 7;
- int64 origin_energy_limit = 8;
- bytes code_hash = 9;
- bytes trx_hash = 10;
-}
-
message InternalTransaction {
// internalTransaction identity, the root InternalTransaction hash
// should equals to root transaction id.
@@ -678,4 +628,4 @@ message NodeInfo {
string stackTrace = 7;
}
}
-}
+}
\ No newline at end of file
diff --git a/core/contract/account_contract.proto b/core/contract/account_contract.proto
new file mode 100644
index 000000000..d3180048f
--- /dev/null
+++ b/core/contract/account_contract.proto
@@ -0,0 +1,50 @@
+/*
+ * java-tron is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * java-tron is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "Contract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+import "core/Tron.proto";
+
+message AccountCreateContract {
+ bytes owner_address = 1;
+ bytes account_address = 2;
+ AccountType type = 3;
+}
+
+// Update account name. Account name is not unique now.
+message AccountUpdateContract {
+ bytes account_name = 1;
+ bytes owner_address = 2;
+}
+
+// Set account id if the account has no id. Account id is unique and case insensitive.
+message SetAccountIdContract {
+ bytes account_id = 1;
+ bytes owner_address = 2;
+}
+
+message AccountPermissionUpdateContract {
+ bytes owner_address = 1;
+ Permission owner = 2; //Empty is invalidate
+ Permission witness = 3; //Can be empty
+ repeated Permission actives = 4; //Empty is invalidate
+}
+
diff --git a/core/contract/asset_issue_contract.proto b/core/contract/asset_issue_contract.proto
new file mode 100644
index 000000000..f2e515e57
--- /dev/null
+++ b/core/contract/asset_issue_contract.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "AssetIssueContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message AssetIssueContract {
+ string id = 41;
+
+ message FrozenSupply {
+ int64 frozen_amount = 1;
+ int64 frozen_days = 2;
+ }
+ bytes owner_address = 1;
+ bytes name = 2;
+ bytes abbr = 3;
+ int64 total_supply = 4;
+ repeated FrozenSupply frozen_supply = 5;
+ int32 trx_num = 6;
+ int32 precision = 7;
+ int32 num = 8;
+ int64 start_time = 9;
+ int64 end_time = 10;
+ int64 order = 11; // useless
+ int32 vote_score = 16;
+ bytes description = 20;
+ bytes url = 21;
+ int64 free_asset_net_limit = 22;
+ int64 public_free_asset_net_limit = 23;
+ int64 public_free_asset_net_usage = 24;
+ int64 public_latest_free_net_time = 25;
+}
+
+message TransferAssetContract {
+ bytes asset_name = 1; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
+ bytes owner_address = 2;
+ bytes to_address = 3;
+ int64 amount = 4;
+}
+
+message UnfreezeAssetContract {
+ bytes owner_address = 1;
+}
+
+message UpdateAssetContract {
+ bytes owner_address = 1;
+ bytes description = 2;
+ bytes url = 3;
+ int64 new_limit = 4;
+ int64 new_public_limit = 5;
+}
+
+message ParticipateAssetIssueContract {
+ bytes owner_address = 1;
+ bytes to_address = 2;
+ bytes asset_name = 3; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
+ int64 amount = 4; // the amount of drops
+}
\ No newline at end of file
diff --git a/core/contract/balance_contract.proto b/core/contract/balance_contract.proto
new file mode 100644
index 000000000..1ce29a0cd
--- /dev/null
+++ b/core/contract/balance_contract.proto
@@ -0,0 +1,36 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "FreezeBalanceContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+import "core/contract/common.proto";
+
+message FreezeBalanceContract {
+ bytes owner_address = 1;
+ int64 frozen_balance = 2;
+ int64 frozen_duration = 3;
+
+ ResourceCode resource = 10;
+ bytes receiver_address = 15;
+}
+
+
+message UnfreezeBalanceContract {
+ bytes owner_address = 1;
+
+ ResourceCode resource = 10;
+ bytes receiver_address = 15;
+}
+
+message WithdrawBalanceContract {
+ bytes owner_address = 1;
+}
+
+message TransferContract {
+ bytes owner_address = 1;
+ bytes to_address = 2;
+ int64 amount = 3;
+}
\ No newline at end of file
diff --git a/core/contract/common.proto b/core/contract/common.proto
new file mode 100644
index 000000000..561767186
--- /dev/null
+++ b/core/contract/common.proto
@@ -0,0 +1,12 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "common"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+enum ResourceCode {
+ BANDWIDTH = 0x00;
+ ENERGY = 0x01;
+}
\ No newline at end of file
diff --git a/core/contract/exchange_contract.proto b/core/contract/exchange_contract.proto
new file mode 100644
index 000000000..a2f878c57
--- /dev/null
+++ b/core/contract/exchange_contract.proto
@@ -0,0 +1,37 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "ExchangeCreateContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message ExchangeCreateContract {
+ bytes owner_address = 1;
+ bytes first_token_id = 2;
+ int64 first_token_balance = 3;
+ bytes second_token_id = 4;
+ int64 second_token_balance = 5;
+}
+
+message ExchangeInjectContract {
+ bytes owner_address = 1;
+ int64 exchange_id = 2;
+ bytes token_id = 3;
+ int64 quant = 4;
+}
+
+message ExchangeWithdrawContract {
+ bytes owner_address = 1;
+ int64 exchange_id = 2;
+ bytes token_id = 3;
+ int64 quant = 4;
+}
+
+message ExchangeTransactionContract {
+ bytes owner_address = 1;
+ int64 exchange_id = 2;
+ bytes token_id = 3;
+ int64 quant = 4;
+ int64 expected = 5;
+}
\ No newline at end of file
diff --git a/core/contract/proposal_contract.proto b/core/contract/proposal_contract.proto
new file mode 100644
index 000000000..6cd25fab0
--- /dev/null
+++ b/core/contract/proposal_contract.proto
@@ -0,0 +1,23 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "ProposalApproveContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message ProposalApproveContract {
+ bytes owner_address = 1;
+ int64 proposal_id = 2;
+ bool is_add_approval = 3; // add or remove approval
+}
+
+message ProposalCreateContract {
+ bytes owner_address = 1;
+ map parameters = 2;
+}
+
+message ProposalDeleteContract {
+ bytes owner_address = 1;
+ int64 proposal_id = 2;
+}
\ No newline at end of file
diff --git a/core/contract/shield_contract.proto b/core/contract/shield_contract.proto
new file mode 100644
index 000000000..9119a7aef
--- /dev/null
+++ b/core/contract/shield_contract.proto
@@ -0,0 +1,81 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "ShieldedTransferContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+// for shielded transaction
+
+message AuthenticationPath {
+ repeated bool value = 1;
+}
+
+message MerklePath {
+ repeated AuthenticationPath authentication_paths = 1;
+ repeated bool index = 2;
+ bytes rt = 3;
+}
+
+message OutputPoint {
+ bytes hash = 1;
+ int32 index = 2;
+}
+
+message OutputPointInfo {
+ repeated OutputPoint out_points = 1;
+ int32 block_num = 2;
+}
+
+message PedersenHash {
+ bytes content = 1;
+}
+
+message IncrementalMerkleTree {
+ PedersenHash left = 1;
+ PedersenHash right = 2;
+ repeated PedersenHash parents = 3;
+}
+
+message IncrementalMerkleVoucher {
+ IncrementalMerkleTree tree = 1;
+ repeated PedersenHash filled = 2;
+ IncrementalMerkleTree cursor = 3;
+ int64 cursor_depth = 4;
+ bytes rt = 5;
+ OutputPoint output_point = 10;
+}
+
+message IncrementalMerkleVoucherInfo {
+ repeated IncrementalMerkleVoucher vouchers = 1;
+ repeated bytes paths = 2;
+}
+
+message SpendDescription {
+ bytes value_commitment = 1;
+ bytes anchor = 2; // merkle root
+ bytes nullifier = 3; // used for check double spend
+ bytes rk = 4; // used for check spend authority signature
+ bytes zkproof = 5;
+ bytes spend_authority_signature = 6;
+}
+
+message ReceiveDescription {
+ bytes value_commitment = 1;
+ bytes note_commitment = 2;
+ bytes epk = 3; // for Encryption
+ bytes c_enc = 4; // Encryption for incoming, decrypt it with ivk
+ bytes c_out = 5; // Encryption for audit, decrypt it with ovk
+ bytes zkproof = 6;
+}
+
+message ShieldedTransferContract {
+ bytes transparent_from_address = 1; // transparent address
+ int64 from_amount = 2;
+ repeated SpendDescription spend_description = 3;
+ repeated ReceiveDescription receive_description = 4;
+ bytes binding_signature = 5;
+ bytes transparent_to_address = 6; // transparent address
+ int64 to_amount = 7; // the amount to transparent to_address
+}
diff --git a/core/contract/smart_contract.proto b/core/contract/smart_contract.proto
new file mode 100644
index 000000000..642264679
--- /dev/null
+++ b/core/contract/smart_contract.proto
@@ -0,0 +1,89 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "CreateSmartContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+import "core/Tron.proto";
+
+message SmartContract {
+ message ABI {
+ message Entry {
+ enum EntryType {
+ UnknownEntryType = 0;
+ Constructor = 1;
+ Function = 2;
+ Event = 3;
+ Fallback = 4;
+ }
+ message Param {
+ bool indexed = 1;
+ string name = 2;
+ string type = 3;
+ // SolidityType type = 3;
+ }
+ enum StateMutabilityType {
+ UnknownMutabilityType = 0;
+ Pure = 1;
+ View = 2;
+ Nonpayable = 3;
+ Payable = 4;
+ }
+
+ bool anonymous = 1;
+ bool constant = 2;
+ string name = 3;
+ repeated Param inputs = 4;
+ repeated Param outputs = 5;
+ EntryType type = 6;
+ bool payable = 7;
+ StateMutabilityType stateMutability = 8;
+ }
+ repeated Entry entrys = 1;
+ }
+ bytes origin_address = 1;
+ bytes contract_address = 2;
+ ABI abi = 3;
+ bytes bytecode = 4;
+ int64 call_value = 5;
+ int64 consume_user_resource_percent = 6;
+ string name = 7;
+ int64 origin_energy_limit = 8;
+ bytes code_hash = 9;
+ bytes trx_hash = 10;
+}
+
+message CreateSmartContract {
+ bytes owner_address = 1;
+ SmartContract new_contract = 2;
+ int64 call_token_value = 3;
+ int64 token_id = 4;
+}
+
+message TriggerSmartContract {
+ bytes owner_address = 1;
+ bytes contract_address = 2;
+ int64 call_value = 3;
+ bytes data = 4;
+ int64 call_token_value = 5;
+ int64 token_id = 6;
+}
+
+message ClearABIContract {
+ bytes owner_address = 1;
+ bytes contract_address = 2;
+}
+
+message UpdateSettingContract {
+ bytes owner_address = 1;
+ bytes contract_address = 2;
+ int64 consume_user_resource_percent = 3;
+}
+
+message UpdateEnergyLimitContract {
+ bytes owner_address = 1;
+ bytes contract_address = 2;
+ int64 origin_energy_limit = 3;
+}
\ No newline at end of file
diff --git a/core/contract/storage_contract.proto b/core/contract/storage_contract.proto
new file mode 100644
index 000000000..666e6b11f
--- /dev/null
+++ b/core/contract/storage_contract.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "BuyStorageBytesContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message BuyStorageBytesContract {
+ bytes owner_address = 1;
+ int64 bytes = 2; // storage bytes for buy
+}
+
+message BuyStorageContract {
+ bytes owner_address = 1;
+ int64 quant = 2; // trx quantity for buy storage (sun)
+}
+
+message SellStorageContract {
+ bytes owner_address = 1;
+ int64 storage_bytes = 2;
+}
+
+message UpdateBrokerageContract {
+ bytes owner_address = 1;
+ int32 brokerage = 2; // 1 mean 1%
+}
diff --git a/core/contract/vote_asset_contract.proto b/core/contract/vote_asset_contract.proto
new file mode 100644
index 000000000..0ca124773
--- /dev/null
+++ b/core/contract/vote_asset_contract.proto
@@ -0,0 +1,14 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "VoteAssetContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message VoteAssetContract {
+ bytes owner_address = 1;
+ repeated bytes vote_address = 2;
+ bool support = 3;
+ int32 count = 5;
+}
\ No newline at end of file
diff --git a/core/contract/witness_contract.proto b/core/contract/witness_contract.proto
new file mode 100644
index 000000000..acd4292a4
--- /dev/null
+++ b/core/contract/witness_contract.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+
+package protocol;
+
+option java_package = "org.tron.protos.contract"; //Specify the name of the package that generated the Java file
+//option java_outer_classname = "WitnessCreateContract"; //Specify the class name of the generated Java file
+option go_package = "github.com/tronprotocol/grpc-gateway/core";
+
+message WitnessCreateContract {
+ bytes owner_address = 1;
+ bytes url = 2;
+}
+
+message WitnessUpdateContract {
+ bytes owner_address = 1;
+ bytes update_url = 12;
+}
+
+message VoteWitnessContract {
+ message Vote {
+ bytes vote_address = 1;
+ int64 vote_count = 2;
+ }
+ bytes owner_address = 1;
+ repeated Vote votes = 2;
+ bool support = 3;
+}
\ No newline at end of file
diff --git a/core/tron/account.proto b/core/tron/account.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/block.proto b/core/tron/block.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/delegated_resource.proto b/core/tron/delegated_resource.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/p2p.proto b/core/tron/p2p.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/proposal.proto b/core/tron/proposal.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/transaction.proto b/core/tron/transaction.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/vote.proto b/core/tron/vote.proto
new file mode 100644
index 000000000..e69de29bb
diff --git a/core/tron/witness.proto b/core/tron/witness.proto
new file mode 100644
index 000000000..e69de29bb