diff --git a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java index f222d98..490dc69 100644 --- a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java +++ b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java @@ -575,7 +575,7 @@ public class OutputDescriptor { return builder.toString(); } - private List sortExtendedPubKeys(Collection keys) { + public List sortExtendedPubKeys(Collection keys) { List sortedKeys = new ArrayList<>(keys); if(mapChildrenDerivations == null || mapChildrenDerivations.isEmpty() || mapChildrenDerivations.containsKey(null)) { return sortedKeys; diff --git a/src/main/java/com/sparrowwallet/drongo/crypto/ECKey.java b/src/main/java/com/sparrowwallet/drongo/crypto/ECKey.java index 676e193..9db942a 100644 --- a/src/main/java/com/sparrowwallet/drongo/crypto/ECKey.java +++ b/src/main/java/com/sparrowwallet/drongo/crypto/ECKey.java @@ -326,6 +326,12 @@ public class ECKey { return pub.get(); } + /** Multiply the public point by the provided private key */ + public ECKey multiply(BigInteger privKey) { + ECPoint point = pub.get().multiply(privKey); + return ECKey.fromPublicOnly(point, false); + } + /** * Gets the private key in the form of an integer field element. The public key is derived by performing EC * point addition this number of times (i.e. point multiplying).