From 05d73f68991be0a54a1498a4feab807363d9d0c5 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 13 Aug 2018 18:41:24 -0700 Subject: [PATCH] waddrmgr: add new DerivationInfo method to ManagedPubKeyAddress In this commit, we add a new method DerivationInfo to the ManagedPubKeyAddress interface. This method is meant to provide callers with the information necessary to independently derive each key returned by the various methods provided to derive addresses. --- waddrmgr/address.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/waddrmgr/address.go b/waddrmgr/address.go index df7687b..d5ddc41 100644 --- a/waddrmgr/address.go +++ b/waddrmgr/address.go @@ -103,6 +103,12 @@ type ManagedPubKeyAddress interface { // ExportPrivKey returns the private key associated with the address // serialized as Wallet Import Format (WIF). ExportPrivKey() (*btcutil.WIF, error) + + // DerivationInfo contains the information required to derive the key + // that backs the address via traditional methods from the HD root. For + // imported keys, the first value will be set to false to indicate that + // we don't know exactly how the key was derived. + DerivationInfo() (bool, KeyScope, DerivationPath) } // ManagedScriptAddress extends ManagedAddress and represents a pay-to-script-hash