From e561997de613fe6856db37ff48702d3e9f41cd39 Mon Sep 17 00:00:00 2001 From: "Enot (ded) Skelly" Date: Fri, 22 May 2026 12:10:54 -0700 Subject: [PATCH] add default keys w/public allows default keys and future extra keys from config maybe add some other live decoding or something too, store hashtag channel keys in the db? --- internal/keystore/keystore.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/keystore/keystore.go b/internal/keystore/keystore.go index 5e71dd7..16a4e90 100644 --- a/internal/keystore/keystore.go +++ b/internal/keystore/keystore.go @@ -3,13 +3,23 @@ // Future: add a DB-backed fallback that checks the channel_keys table. package keystore -import "encoding/hex" +import ( + "encoding/hex" + "maps" +) type MapKeyStore struct { keys map[string][]byte // channel hash hex string → key bytes } -func NewMapKeyStore(keys map[string][]byte) *MapKeyStore { +var defaultKeys = map[string][]byte{ + "11": {0x8b, 0x33, 0x87, 0xe9, 0xc5, 0xcd, 0xea, 0x6a, 0xc9, 0xe5, 0xed, 0xba, 0xa1, 0x15, 0xcd, 0x72}, // public channel +} + +func NewMapKeyStore(extra map[string][]byte) *MapKeyStore { + keys := make(map[string][]byte) + maps.Copy(keys, defaultKeys) + maps.Copy(keys, extra) return &MapKeyStore{keys} }