We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8deef7 commit 2d1bf02Copy full SHA for 2d1bf02
x/lending/types/utils.go
@@ -0,0 +1,15 @@
1
+package types
2
+
3
+import "github.com/btcsuite/btcd/btcec/v2"
4
5
+// SecretToPubKey gets the serialized public key of the given secret on the secp256k1 curve
6
+// Assume that the secret is 256-bit bytes
7
+func SecretToPubKey(secretBytes []byte) []byte {
8
+ var secret btcec.ModNScalar
9
+ _ = secret.SetByteSlice(secretBytes)
10
11
+ var result btcec.JacobianPoint
12
+ btcec.ScalarBaseMultNonConst(&secret, &result)
13
14
+ return btcec.JacobianToByteSlice(result)
15
+}
0 commit comments