Skip to content

Commit

Permalink
feat: update pczt
Browse files Browse the repository at this point in the history
  • Loading branch information
soralit committed Oct 10, 2024
1 parent 90596a9 commit 13f57a2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion rust/pczt/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fn main() -> Result<(), std::io::Error> {
prost_build::Config::new().out_dir("src/pb").compile_protos(&["src/protos/pczt.proto"], &["src/"])?;
prost_build::Config::new().out_dir("src/protos").compile_protos(&["src/protos/pczt.proto"], &["src/"])?;
Ok(())
}
4 changes: 1 addition & 3 deletions rust/pczt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![no_std]

pub mod protos {
include!("pb/pczt.rs");
}
pub mod protos;
2 changes: 2 additions & 0 deletions rust/pczt/src/protos/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod pczt;
pub use pczt::*;
22 changes: 12 additions & 10 deletions rust/pczt/src/protos/pczt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,17 @@ message PcztOrchardAction {
bytes nf = 1;
bytes rk = 2;
bytes cmx = 3;
//(epk, enc_ciphertext, out_ciphertext)
bytes encryptedNote = 4;
bytes cv_net = 5;
bytes epk = 4;
bytes encCipherText = 5;
bytes outCipherText = 6;
bytes cv_net = 7;

bytes alpha = 6;
bytes alpha = 8;

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

message PcztSapling {
Expand All @@ -115,9 +116,10 @@ message PcztSaplingSpend {
message PcztSaplingOutput {
bytes cv = 1;
bytes cmu = 2;
//(epk, enc_ciphertext, out_ciphertext)
bytes encryptedNote = 3;
bytes epk = 3;
bytes encCipherText = 4;
bytes outCipherText = 5;

// if an output has path, it is a change output
optional PcztDerivationPath path = 4;
optional PcztDerivationPath path = 6;
}
24 changes: 15 additions & 9 deletions rust/pczt/src/pb/pczt.rs → rust/pczt/src/protos/pczt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,22 @@ pub struct PcztOrchardAction {
pub rk: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub cmx: ::prost::alloc::vec::Vec<u8>,
/// (epk, enc_ciphertext, out_ciphertext)
#[prost(bytes = "vec", tag = "4")]
pub encrypted_note: ::prost::alloc::vec::Vec<u8>,
pub epk: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "5")]
pub cv_net: ::prost::alloc::vec::Vec<u8>,
pub enc_cipher_text: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "6")]
pub out_cipher_text: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "7")]
pub cv_net: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "8")]
pub alpha: ::prost::alloc::vec::Vec<u8>,
/// the serilized spend note(rho, rseed, value, receipent) of this action, to verify the nf and cmx in this action.
#[prost(bytes = "vec", tag = "7")]
#[prost(bytes = "vec", tag = "9")]
pub spend_note: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "8")]
#[prost(message, optional, tag = "10")]
pub path: ::core::option::Option<PcztDerivationPath>,
#[prost(bytes = "vec", repeated, tag = "9")]
#[prost(bytes = "vec", repeated, tag = "11")]
pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -158,10 +161,13 @@ pub struct PcztSaplingOutput {
pub cv: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub cmu: ::prost::alloc::vec::Vec<u8>,
/// (epk, enc_ciphertext, out_ciphertext)
#[prost(bytes = "vec", tag = "3")]
pub encrypted_note: ::prost::alloc::vec::Vec<u8>,
pub epk: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "4")]
pub enc_cipher_text: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "5")]
pub out_cipher_text: ::prost::alloc::vec::Vec<u8>,
/// if an output has path, it is a change output
#[prost(message, optional, tag = "4")]
#[prost(message, optional, tag = "6")]
pub path: ::core::option::Option<PcztDerivationPath>,
}

0 comments on commit 13f57a2

Please sign in to comment.