From 872f337811fa2f2b34eff4e1f9c24e2abaa31483 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 2 Aug 2021 14:54:48 -0600 Subject: [PATCH] Expose SpendingKey byte representation. --- src/keys.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/keys.rs b/src/keys.rs index 708a546f..ca1c9774 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -64,6 +64,11 @@ impl SpendingKey { let ivk = KeyAgreementPrivateKey::derive_inner(&(&sk).into()); CtOption::new(sk, !(ask.ct_is_zero() | ivk.is_none())) } + + /// Returns the raw bytes of the spending key. + pub fn to_bytes(&self) -> &[u8; 32] { + &self.0 + } } /// A spend authorizing key, used to create spend authorization signatures.