Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
dc9b460
add
zergweak Oct 30, 2018
8ebf3af
add proto for merkleTree
sean-liu55 Nov 2, 2018
5f9d1c1
feat(nf_storage): add storage and rpc for nullifier
Nov 2, 2018
19881e4
Merge branch 'develop_zksnark' into feature/nf_storage
Nov 5, 2018
f899f89
add rpc proto , GetBestMerkleRoot()
sean-liu55 Nov 5, 2018
d4fb965
Merge remote-tracking branch 'origin/develop_zksnark' into develop_zk…
sean-liu55 Nov 5, 2018
b799bb4
modify merkle root
zergweak Nov 5, 2018
d6a3f41
add GetMerklePath
zergweak Nov 5, 2018
40f0732
add rpc for merkleWitness
sean-liu55 Nov 5, 2018
10d7223
feat: add get_merkle_path rpc
Nov 5, 2018
d92df1d
Merge branch 'develop_zksnark' of ssh://github.com/tronprotocol/java-…
Nov 5, 2018
b4f428f
feat(merkle_rpc): add get_best_merkle_root rpc
Nov 6, 2018
77dd737
refractor merkleWitness
sean-liu55 Nov 6, 2018
b37329d
Merge remote-tracking branch 'origin/develop_zksnark' into develop_zk…
sean-liu55 Nov 6, 2018
3cc1eb5
modify getbestmerkleroot
zergweak Nov 6, 2018
4ac24b5
use OutputPoint as witnessKey
sean-liu55 Nov 7, 2018
25651ea
feat(zksnark_rpc): add getMerkleTreeWitness rpc
Nov 7, 2018
41bff16
change outPoint
sean-liu55 Nov 13, 2018
d422fb4
add rt into IncrementalMerkleWitness
sean-liu55 Nov 13, 2018
b81e204
feat(generate_shield_address): add generateShieldAddress http api
Nov 27, 2018
4d54938
feat(generateshieldaddress): update contract
Nov 27, 2018
33d964b
feat(generateshieldaddress): add generateshieldaddress rpc
Nov 28, 2018
91926b4
add GRPC GetZKBlockByLimitNext and GetMerkleTreeOfBlock
houlei1017 Dec 3, 2018
93d8722
add getMerkleTreeWitnessInfo
sean-liu55 Dec 4, 2018
d701e71
minor change
nanfengpo Dec 12, 2018
7b0d46f
minor change
nanfengpo Dec 13, 2018
905e8d5
1 Add ZKSanrk transaction fee, currently 1TRX
houlei1017 Dec 18, 2018
38b8fad
Merge branch 'master' into develop_zksnark
zergweak Dec 18, 2018
0304cea
merge maseter
zergweak Dec 18, 2018
3d196a7
merge config
zergweak Dec 18, 2018
dab5519
Merge branch 'multi_sign' into develop_zksnark
zergweak Dec 18, 2018
44901ed
Merge branch 'develop' into feature/develop_zksnark_2
sean-liu55 Mar 18, 2019
7315288
fix conflict
sean-liu55 Mar 18, 2019
fe28f2e
change class name
sean-liu55 Mar 18, 2019
8eb9300
add proto about shielded tx
renchenchang Apr 9, 2019
94e63af
rename OutputDescription
renchenchang Apr 9, 2019
a1165c5
proto re defination
renchenchang Apr 10, 2019
d4beb81
merge master into branch
renchenchang Apr 10, 2019
db7a738
add stament defination
renchenchang Apr 10, 2019
f7f523b
add api for ShieldedTransaction
renchenchang Apr 10, 2019
dfe5b7c
api for shielded tx
renchenchang Apr 10, 2019
7a9fdb8
rename the fields in shielded transaction
renchenchang Apr 10, 2019
6b0027c
rename sign in proto
renchenchang Apr 11, 2019
1a98c32
annotation for proto
renchenchang Apr 11, 2019
4348559
annotation for proto
renchenchang Apr 11, 2019
b904ff0
annotation for proto
renchenchang Apr 11, 2019
23a0b5b
fix proto error
sean-liu55 Apr 11, 2019
3ad9110
Merge remote-tracking branch 'origin/feature/develop_zksnark_2' into …
sean-liu55 Apr 11, 2019
c0ec511
add capsule
sean-liu55 Apr 11, 2019
d6dbbaa
rename field in proto
renchenchang Apr 12, 2019
20378ed
debug create spendProof
sean-liu55 Apr 15, 2019
187566a
feat(pedersen_hash): modify 256hash to perdersen
Apr 15, 2019
186d905
update desc for path in proto
renchenchang Apr 15, 2019
ba69102
Merge branch 'feature/develop_zksnark_2' of github.com:tronprotocol/j…
renchenchang Apr 15, 2019
b91c921
rm unless lines
renchenchang Apr 16, 2019
98669eb
valuebalance byte[] to long
Yrp Apr 16, 2019
7b5922c
Merge branch 'feature/develop_zksnark_2' of github.com:tronprotocol/j…
Yrp Apr 16, 2019
0ec2c19
modify ammount data type
olenheim Apr 16, 2019
d25f1f4
test scan
317787106 Apr 28, 2019
f316473
rm chinese desc
renchenchang Apr 28, 2019
93f9551
test encrypt and decrypt after push transaction.
317787106 Apr 28, 2019
fe624e3
refactor proto for shielded transaction
renchenchang Apr 29, 2019
3ed7cf8
rm value_balance in ShieldedTransferContract
renchenchang Apr 29, 2019
aa50866
feat(zen_api): add some msg structs
May 5, 2019
0b7ef19
feat(zen_api): add api definition
May 6, 2019
c03b25f
feat(gen_api): update proto
May 6, 2019
e82e45f
feat(gen_api): add four zen api: sk, esk, ak, nk
May 6, 2019
585e03e
add fee in PrivateParameters
renchenchang May 7, 2019
f5bf938
feat(createshieldedtransaction): add createshieldedtransaction api
May 8, 2019
0e9458d
add two column in DecryptNotes proto
317787106 May 9, 2019
ce185a1
feat(zen_api): update createshieldedtransaction, add api for rcm
May 9, 2019
cf12ee0
Merge branch 'feature/develop_zksnark_2' of ssh://github.com/tronprot…
May 9, 2019
12bbabb
modify two function name
317787106 May 9, 2019
65d7e69
modity scan function name
317787106 May 9, 2019
5dcfdb9
add path into IncrementalMerkleVoucherInfo
sean-liu55 May 9, 2019
1e70ff5
change OutputPointInfo proto
sean-liu55 May 10, 2019
d8bcdd1
fix test conflict
sean-liu55 May 10, 2019
16c19f7
feat(zn_api): update createshieldedtransaction process
May 10, 2019
1dc8d3b
rename class
sean-liu55 May 13, 2019
3059353
rm useless code && rename class
sean-liu55 May 15, 2019
c1f8b60
rm useless code
sean-liu55 May 15, 2019
8602875
rm useless code
sean-liu55 May 15, 2019
777b09f
refactor proto
renchenchang May 16, 2019
c5f70b5
typo: remove unused codes
May 16, 2019
9fb2559
Merge branch 'feature/develop_zksnark_2' of ssh://github.com/tronprot…
May 16, 2019
e53b4b0
rm message-GrothProof and format code
sean-liu55 May 21, 2019
ce1e91c
feat(zen_api): add api isspend to check if a note has been spent
May 21, 2019
ec9b5ae
Merge branch 'feature/develop_zksnark_2' of ssh://github.com/tronprot…
May 21, 2019
9fbb817
rm sprout api
renchenchang May 23, 2019
9c2ef37
Remove ZksnarkV0TransferContract and optimize code in bandwidthProcessor
sean-liu55 May 24, 2019
6a3666f
remove fee from ShieldedTransferContract
olenheim May 24, 2019
fc0a6ca
merge develop
renchenchang May 24, 2019
dd4bbe8
add api for spend auth sig
renchenchang May 25, 2019
be55dd5
api getShieldTransactionHash
renchenchang May 25, 2019
60d1f67
api getShieldTransactionHash
renchenchang May 25, 2019
1d3eb23
api getShieldTransactionHash
renchenchang May 25, 2019
3d51d2f
api getShieldTransactionHash
renchenchang May 25, 2019
cb00cc3
api getShieldTransactionHash
renchenchang May 25, 2019
593acac
rm zk-sign in transaction
renchenchang May 27, 2019
9b0898c
add two interface to grpc and http
317787106 May 27, 2019
d5e15cf
typo: add sign check when build zen_transaction
May 27, 2019
f9962c2
Merge branch 'feature/develop_zksnark_2' of ssh://github.com/tronprot…
May 27, 2019
1088234
feat: add api createshieldedtransactionwithoutspendauthsig
May 27, 2019
ccd5848
modify interface GetShieldTransactionHash
317787106 May 28, 2019
94ca02a
add zen transfer actuator for TRC10 token shielded transfer
olenheim May 28, 2019
c415fab
feat: update note proto
May 30, 2019
9f37465
rafactor note in proto
renchenchang May 30, 2019
5a091e0
refactor function name
renchenchang May 30, 2019
905e17a
Merge branch 'feature/develop_zksnark_2' of https://github.com/tronpr…
olenheim May 30, 2019
0020b5c
add zksnarkclient
Yrp May 30, 2019
007a4cf
Merge branch 'feature/develop_zksnark_2' of https://github.com/tronpr…
olenheim May 30, 2019
aa80e6d
feat: add 4 query api to solidity node
Jun 3, 2019
6d39415
Merge branch 'feature/develop_zksnark_2' into feature/zenToken
Jun 3, 2019
6fad36c
rm zenShieldedTransferContract
renchenchang Jun 13, 2019
c079ec6
rm useless api
renchenchang Jun 13, 2019
40fca8b
merge develop
renchenchang Jun 13, 2019
0cd602a
feat: update shielded fee to new param
Jun 19, 2019
1d9d252
typo: update param with '-'
Jun 19, 2019
bff46ed
fix: fix typo error
Jun 19, 2019
8a5c127
add wallet api scanandmarknotebyivk and modify api IsSpendServlet
317787106 Jun 25, 2019
18cf4ce
add scanAndMarkNoteByIvk to rpc api
317787106 Jun 26, 2019
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
222 changes: 217 additions & 5 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ service Wallet {
//Use this function instead of CreateAccount.
rpc CreateAccount2 (AccountCreateContract) returns (TransactionExtention) {
}

//Please use CreateWitness2 instead of this function.
rpc CreateWitness (WitnessCreateContract) returns (Transaction) {
option (google.api.http) = {
Expand Down Expand Up @@ -406,7 +407,7 @@ service Wallet {

rpc TriggerConstantContract (TriggerSmartContract) returns (TransactionExtention) {
}

rpc ClearContractABI (ClearABIContract) returns (TransactionExtention) {
}

Expand Down Expand Up @@ -614,7 +615,6 @@ service Wallet {
};
}


rpc AddSign (TransactionSign) returns (TransactionExtention) {

}
Expand All @@ -623,14 +623,69 @@ service Wallet {

}

rpc GetTransactionApprovedList(Transaction) returns (TransactionApprovedList) {
rpc GetTransactionApprovedList (Transaction) returns (TransactionApprovedList) {

}

rpc GetNodeInfo (EmptyMessage) returns (NodeInfo) {
};
};

// for shiededTransaction
rpc CreateShieldedTransaction (PrivateParameters) returns (TransactionExtention) {
};

rpc GetMerkleTreeVoucherInfo (OutputPointInfo) returns (IncrementalMerkleVoucherInfo) {
}

rpc ScanNoteByIvk (IvkDecryptParameters) returns (DecryptNotes) {
};

rpc ScanAndMarkNoteByIvk (IvkDecryptAndMarkParameters) returns (DecryptNotesMarked) {
};

rpc ScanNoteByOvk (OvkDecryptParameters) returns (DecryptNotes) {
};

rpc GetSpendingKey (EmptyMessage) returns (BytesMessage) {
}

rpc GetExpandedSpendingKey (BytesMessage) returns (ExpandedSpendingKeyMessage) {
}

rpc GetAkFromAsk (BytesMessage) returns (BytesMessage) {
}

rpc GetNkFromNsk (BytesMessage) returns (BytesMessage) {
}

rpc GetIncomingViewingKey (ViewingKeyMessage) returns (IncomingViewingKeyMessage) {
}

rpc GetDiversifier (EmptyMessage) returns (DiversifierMessage) {
}

rpc GetZenPaymentAddress (IncomingViewingKeyDiversifierMessage) returns (PaymentAddressMessage) {
}

rpc GetRcm (EmptyMessage) returns (BytesMessage) {
}

rpc IsSpend (NoteParameters) returns (SpendResult) {
}

rpc CreateShieldedTransactionWithoutSpendAuthSig (PrivateParametersWithoutAsk) returns (TransactionExtention) {
};

rpc GetShieldTransactionHash (Transaction) returns (BytesMessage) {
};

rpc CreateSpendAuthSig (SpendAuthSigParameters) returns (BytesMessage) {
};

rpc CreateShieldNullifier (NfParameters) returns (BytesMessage) {
};
// end for shiededTransaction
};

service WalletSolidity {

Expand Down Expand Up @@ -761,6 +816,21 @@ service WalletSolidity {
}
};
}

rpc GetMerkleTreeVoucherInfo (OutputPointInfo) returns (IncrementalMerkleVoucherInfo) {
}

rpc ScanNoteByIvk (IvkDecryptParameters) returns (DecryptNotes) {
}

rpc ScanAndMarkNoteByIvk (IvkDecryptAndMarkParameters) returns (DecryptNotesMarked) {
}

rpc ScanNoteByOvk (OvkDecryptParameters) returns (DecryptNotes) {
}

rpc IsSpend (NoteParameters) returns (SpendResult) {
}
};

service WalletExtension {
Expand Down Expand Up @@ -1006,6 +1076,11 @@ message TransactionListExtention {
repeated TransactionExtention transaction = 1;
}

message BlockIncrementalMerkleTree {
int64 number = 1;
IncrementalMerkleTree merkleTree = 2;
}

message TransactionSignWeight {
message Result {
enum response_code {
Expand Down Expand Up @@ -1042,4 +1117,141 @@ message TransactionApprovedList {
repeated bytes approved_list = 2;
Result result = 4;
TransactionExtention transaction = 5;
}
}

message IvkDecryptParameters {
int64 start_block_index = 1;
int64 end_block_index = 2;
bytes ivk = 3;
}

message IvkDecryptAndMarkParameters {
int64 start_block_index = 1;
int64 end_block_index = 2;
bytes ivk = 5;
bytes ak = 3;
bytes nk = 4;
}

message OvkDecryptParameters {
int64 start_block_index = 1;
int64 end_block_index = 2;
bytes ovk = 3;
}

message DecryptNotes {
message NoteTx {
Note note = 1;
bytes txid = 2; //transaction id = sha256(transaction.rowdata)
int32 index = 3; //the index of note in receive
}
repeated NoteTx noteTxs = 1;
}

message DecryptNotesMarked {
message NoteTx {
Note note = 1;
bytes txid = 2; //transaction id = sha256(transaction.rowdata)
int32 index = 3; //the index of note in receive
bool is_spend = 4;
}
repeated NoteTx noteTxs = 1;
}

message Note {
int64 value = 1;
string payment_address = 2;
bytes rcm = 3; // random 32
bytes memo = 4;
}

message SpendNote {
Note note = 3;
bytes alpha = 4; // random number for spend authority signature
IncrementalMerkleVoucher voucher = 5;
bytes path = 6; // path for cm from leaf to root in merkle tree
}

message ReceiveNote {
Note note = 1;
}

message PrivateParameters {
bytes transparent_from_address = 1;
bytes ask = 2;
bytes nsk = 3;
bytes ovk = 4;
int64 from_amount = 5;
repeated SpendNote shielded_spends = 6;
repeated ReceiveNote shielded_receives = 7;
bytes transparent_to_address = 8;
int64 to_amount = 9;
}

message PrivateParametersWithoutAsk {
bytes transparent_from_address = 1;
bytes ak = 2;
bytes nsk = 3;
bytes ovk = 4;
int64 from_amount = 5;
repeated SpendNote shielded_spends = 6;
repeated ReceiveNote shielded_receives = 7;
bytes transparent_to_address = 8;
int64 to_amount = 9;
}

message SpendAuthSigParameters {
bytes ask = 1;
bytes tx_hash = 2;
bytes alpha = 3;
}

message NfParameters {
Note note = 1;
IncrementalMerkleVoucher voucher = 2;
bytes ak = 3;
bytes nk = 4;
}

message ExpandedSpendingKeyMessage {
bytes ask = 1;
bytes nsk = 2;
bytes ovk = 3;
}

message ViewingKeyMessage {
bytes ak = 1;
bytes nk = 2;
}

message IncomingViewingKeyMessage {
bytes ivk = 1;
}

message DiversifierMessage {
bytes d = 1;
}

message IncomingViewingKeyDiversifierMessage {
IncomingViewingKeyMessage ivk = 1;
DiversifierMessage d = 2;
}

message PaymentAddressMessage {
DiversifierMessage d = 1;
bytes pkD = 2;
string payment_address = 3;
}

message NoteParameters {
bytes ak = 1;
bytes nk = 2;
Note note = 3;
bytes txid = 4;
int32 index = 5;
}

message SpendResult {
bool result = 1;
string message = 2;
}
34 changes: 34 additions & 0 deletions api/zksnark.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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
option go_package = "github.com/tronprotocol/grpc-gateway/api";

service TronZksnark {
rpc CheckZksnarkProof (ZksnarkRequest) returns (ZksnarkResponse) {
}
};

message ZksnarkRequest {
Transaction transaction = 1;
bytes sighash = 2;
int64 valueBalance = 3;
string txId = 4;
}

message ZksnarkResponse {
enum Code {
SUCCESS = 0;
FAILED = 1;
}

Code code = 1;
}




Loading