-
Notifications
You must be signed in to change notification settings - Fork 48
Orchard key components #40
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 24 commits
f077979
ceac39d
eaa7158
2750170
5772c71
a61be5d
71542f7
9455158
57c6492
cfaa61a
26701c3
307787e
bf5fb7a
cef44f5
2462bb2
f7cad77
e98f324
e0b40cb
46bf89c
3c8befa
8e55b46
e041726
42ea809
861eec1
51fd94d
05e86a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,23 @@ | ||
| use crate::keys::Diversifier; | ||
| use crate::keys::{DiversifiedTransmissionKey, Diversifier}; | ||
|
|
||
| /// A shielded payment address. | ||
| /// | ||
| /// # Examples | ||
| /// | ||
| /// ``` | ||
| /// use orchard::keys::{SpendingKey, FullViewingKey}; | ||
| /// | ||
| /// let sk = SpendingKey::from_bytes([7; 32]).unwrap(); | ||
| /// let address = FullViewingKey::from(&sk).default_address(); | ||
| /// ``` | ||
| #[derive(Debug)] | ||
| pub struct Address { | ||
| d: Diversifier, | ||
| pk_d: (), | ||
| pk_d: DiversifiedTransmissionKey, | ||
| } | ||
|
|
||
| impl Address { | ||
|
Contributor
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. An idea:
Contributor
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. 👍 this is how I like to write typeclass instances in Haskell, and the analogy to traits is apt: write a function that is typed to whatever you're working on, and then use that function to provide for the generalized dispatch via the trait/typeclass. |
||
| pub(crate) fn from_parts(d: Diversifier, pk_d: DiversifiedTransmissionKey) -> Self { | ||
| Address { d, pk_d } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| //! Constants used in the Orchard protocol. | ||
|
|
||
| /// $\ell^\mathsf{Orchard}_\mathsf{base}$ | ||
| pub(crate) const L_ORCHARD_BASE: usize = 255; |
Uh oh!
There was an error while loading. Please reload this page.