-
Notifications
You must be signed in to change notification settings - Fork 0
Add Orchard versioned signatures and add ALGORITHM_BYTE to ik and IssueAuthSig #129
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
Changes from all commits
bb50fa4
7f4febf
7d7019b
fcc81b1
f57d0ae
c667131
dfcaf9a
9fd213f
4b37c7d
724bde9
04116ba
dee49d6
6accdf2
b8d9252
a8d9057
1973f81
964699c
8a02dcc
dc97a87
c6a131c
c0612e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ use alloc::vec::Vec; | |
|
|
||
| use getset::Getters; | ||
| use serde::{Deserialize, Serialize}; | ||
| use serde_with::serde_as; | ||
|
|
||
| use crate::roles::combiner::merge_map; | ||
|
|
||
|
|
@@ -205,6 +206,18 @@ pub(crate) struct Zip32Derivation { | |
| pub(crate) derivation_path: Vec<u32>, | ||
| } | ||
|
|
||
| /// A versioned Orchard SpendAuth signature. | ||
| /// | ||
| /// A easily serializable structure representing the serializable version of | ||
| /// `orchard::builder::VerSpendAuthSig` struct. | ||
| #[serde_as] | ||
| #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
| pub(crate) struct VerSpendAuthSig { | ||
| pub(crate) sighash_info: Vec<u8>, | ||
| #[serde_as(as = "[_; 64]")] | ||
| pub(crate) signature: [u8; 64], | ||
| } | ||
|
Comment on lines
+213
to
+219
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we import the entire struct from Orchard?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not exactly the same struct than the struct in Orchard. |
||
|
|
||
| /// Determines the lock time for the transaction. | ||
| /// | ||
| /// Implemented following the specification in [BIP 370], with the rationale that this | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only similar thing we have in this project is
Is this consistent with the semantics of
Option<_>forspend_auth_sig?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have a spend auth sig which contains two different fields the sighash version and the signature.
So, spend_auth_sig contains an Option and VerSpendAuthSig contains the sighash version and the signature.
It is similar to
pub(crate) zip32_derivation: Option<Zip32Derivation>The attribute
#[serde_as(as = "[_; 64]")]tellsserde_withto serialize and deserialize the[u8; 64]field as a fixed-size array of 64 elements, since Serde alone does not natively support arrays larger than 32 elements.