THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

main_test.go

TEXT FILE

773 B · Public source code for developers, search crawlers and AI agents

Download / RawBack to folder
Go · 31 lines
1package main
2
3import (
4	"encoding/hex"
5	"github.com/btcsuite/btcd/btcec/v2/schnorr"
6	"testing"
7)
8
9func TestVector(t *testing.T) {
10	k := fixture()
11	h := make([]byte, 32)
12	s, e := schnorr.Sign(k, h, schnorr.CustomNonce([32]byte{}))
13	if e != nil {
14		t.Fatal(e)
15	}
16	want := "e907831f80848d1069a5371b402410364bdf1c5f8307b0084c55f1ce2dca821525f66a4a85ea8b71e482a74f382d2ce5ebeee8fdb2172f477df4900d310536c0"
17	if hex.EncodeToString(s.Serialize()) != want {
18		t.Fatal("BIP340 vector 0 mismatch")
19	}
20	p, e := schnorr.ParsePubKey(schnorr.SerializePubKey(k.PubKey()))
21	if e != nil || !s.Verify(h, p) {
22		t.Fatal("verify failed")
23	}
24	h[0] = 1
25	if s.Verify(h, p) {
26		t.Fatal("tamper accepted")
27	}
28	if _, e := schnorr.ParseSignature([]byte{1}); e == nil {
29		t.Fatal("bad signature")
30	}
31}
Read-only source · Select a line number to link directly · Raw download above

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects