1 // csp is a package of cipher service provider
9 type XPrvKeyer interface {
10 // XPub derives an extended public key from a given xprv.
12 // Derive generates a child xprv by recursively deriving
13 // non-hardened child xprvs over the list of selectors:
14 // `Derive([a,b,c,...]) == Child(a).Child(b).Child(c)...`
15 Derive(path [][]byte) XPrvKeyer
16 // Sign creates an EdDSA signature using expanded private key
17 // derived from the xprv.
18 Sign(msg []byte) []byte
21 type XPubKeyer interface {
22 // PublicKey extracts the public key from an xpub.
23 PublicKey() crypto.PublicKey
24 // Derive generates a child xpub by recursively deriving
25 // non-hardened child xpubs over the list of selectors:
26 // `Derive([a,b,c,...]) == Child(a).Child(b).Child(c)...`
27 Derive(path [][]byte) XPubKeyer
28 // Verify checks an EdDSA signature using public key
29 Verify(msg []byte, sig []byte) bool