Skip to content

Commit 13f57a2

Browse files
committed
feat: update pczt
1 parent 90596a9 commit 13f57a2

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

rust/pczt/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() -> Result<(), std::io::Error> {
2-
prost_build::Config::new().out_dir("src/pb").compile_protos(&["src/protos/pczt.proto"], &["src/"])?;
2+
prost_build::Config::new().out_dir("src/protos").compile_protos(&["src/protos/pczt.proto"], &["src/"])?;
33
Ok(())
44
}

rust/pczt/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#![no_std]
22

3-
pub mod protos {
4-
include!("pb/pczt.rs");
5-
}
3+
pub mod protos;

rust/pczt/src/protos/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod pczt;
2+
pub use pczt::*;

rust/pczt/src/protos/pczt.proto

+12-10
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,17 @@ message PcztOrchardAction {
8080
bytes nf = 1;
8181
bytes rk = 2;
8282
bytes cmx = 3;
83-
//(epk, enc_ciphertext, out_ciphertext)
84-
bytes encryptedNote = 4;
85-
bytes cv_net = 5;
83+
bytes epk = 4;
84+
bytes encCipherText = 5;
85+
bytes outCipherText = 6;
86+
bytes cv_net = 7;
8687

87-
bytes alpha = 6;
88+
bytes alpha = 8;
8889

8990
//the serilized spend note(rho, rseed, value, receipent) of this action, to verify the nf and cmx in this action.
90-
bytes spend_note = 7;
91-
PcztDerivationPath path = 8;
92-
repeated bytes signatures = 9;
91+
bytes spend_note = 9;
92+
PcztDerivationPath path = 10;
93+
repeated bytes signatures = 11;
9394
}
9495

9596
message PcztSapling {
@@ -115,9 +116,10 @@ message PcztSaplingSpend {
115116
message PcztSaplingOutput {
116117
bytes cv = 1;
117118
bytes cmu = 2;
118-
//(epk, enc_ciphertext, out_ciphertext)
119-
bytes encryptedNote = 3;
119+
bytes epk = 3;
120+
bytes encCipherText = 4;
121+
bytes outCipherText = 5;
120122

121123
// if an output has path, it is a change output
122-
optional PcztDerivationPath path = 4;
124+
optional PcztDerivationPath path = 6;
123125
}

rust/pczt/src/pb/pczt.rs rust/pczt/src/protos/pczt.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,22 @@ pub struct PcztOrchardAction {
109109
pub rk: ::prost::alloc::vec::Vec<u8>,
110110
#[prost(bytes = "vec", tag = "3")]
111111
pub cmx: ::prost::alloc::vec::Vec<u8>,
112-
/// (epk, enc_ciphertext, out_ciphertext)
113112
#[prost(bytes = "vec", tag = "4")]
114-
pub encrypted_note: ::prost::alloc::vec::Vec<u8>,
113+
pub epk: ::prost::alloc::vec::Vec<u8>,
115114
#[prost(bytes = "vec", tag = "5")]
116-
pub cv_net: ::prost::alloc::vec::Vec<u8>,
115+
pub enc_cipher_text: ::prost::alloc::vec::Vec<u8>,
117116
#[prost(bytes = "vec", tag = "6")]
117+
pub out_cipher_text: ::prost::alloc::vec::Vec<u8>,
118+
#[prost(bytes = "vec", tag = "7")]
119+
pub cv_net: ::prost::alloc::vec::Vec<u8>,
120+
#[prost(bytes = "vec", tag = "8")]
118121
pub alpha: ::prost::alloc::vec::Vec<u8>,
119122
/// the serilized spend note(rho, rseed, value, receipent) of this action, to verify the nf and cmx in this action.
120-
#[prost(bytes = "vec", tag = "7")]
123+
#[prost(bytes = "vec", tag = "9")]
121124
pub spend_note: ::prost::alloc::vec::Vec<u8>,
122-
#[prost(message, optional, tag = "8")]
125+
#[prost(message, optional, tag = "10")]
123126
pub path: ::core::option::Option<PcztDerivationPath>,
124-
#[prost(bytes = "vec", repeated, tag = "9")]
127+
#[prost(bytes = "vec", repeated, tag = "11")]
125128
pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
126129
}
127130
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -158,10 +161,13 @@ pub struct PcztSaplingOutput {
158161
pub cv: ::prost::alloc::vec::Vec<u8>,
159162
#[prost(bytes = "vec", tag = "2")]
160163
pub cmu: ::prost::alloc::vec::Vec<u8>,
161-
/// (epk, enc_ciphertext, out_ciphertext)
162164
#[prost(bytes = "vec", tag = "3")]
163-
pub encrypted_note: ::prost::alloc::vec::Vec<u8>,
165+
pub epk: ::prost::alloc::vec::Vec<u8>,
166+
#[prost(bytes = "vec", tag = "4")]
167+
pub enc_cipher_text: ::prost::alloc::vec::Vec<u8>,
168+
#[prost(bytes = "vec", tag = "5")]
169+
pub out_cipher_text: ::prost::alloc::vec::Vec<u8>,
164170
/// if an output has path, it is a change output
165-
#[prost(message, optional, tag = "4")]
171+
#[prost(message, optional, tag = "6")]
166172
pub path: ::core::option::Option<PcztDerivationPath>,
167173
}

0 commit comments

Comments
 (0)