-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathmain.go
More file actions
26 lines (21 loc) · 953 Bytes
/
main.go
File metadata and controls
26 lines (21 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"fmt"
"github.com/btcsuite/btcd/chaincfg"
"github.com/bitonicnl/verify-signed-message/pkg"
)
// This example will output `true, <nil>` for both signed messages, since the signature is valid and there are no errors.
func main() {
// Bitcoin Mainnet
fmt.Println(verifier.VerifyWithChain(verifier.SignedMessage{
Address: "18J72YSM9pKLvyXX1XAjFXA98zeEvxBYmw",
Message: "Test123",
Signature: "Gzhfsw0ItSrrTCChykFhPujeTyAcvVxiXwywxpHmkwFiKuUR2ETbaoFcocmcSshrtdIjfm8oXlJoTOLosZp3Yc8=",
}, &chaincfg.MainNetParams))
// Bitcoin Testnet3
fmt.Println(verifier.VerifyWithChain(verifier.SignedMessage{
Address: "tb1qr97cuq4kvq7plfetmxnl6kls46xaka78n2288z",
Message: "The outage comes at a time when bitcoin has been fast approaching new highs not seen since June 26, 2019.",
Signature: "H/bSByRH7BW1YydfZlEx9x/nt4EAx/4A691CFlK1URbPEU5tJnTIu4emuzkgZFwC0ptvKuCnyBThnyLDCqPqT10=",
}, &chaincfg.TestNet3Params))
}