upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/nostr.h
diff options
context:
space:
mode:
authorBitflash-sh <btf01@proton.me>2026-07-24 11:18:11 -0300
committerBitflash-sh <btf01@proton.me>2026-07-24 11:18:11 -0300
commit51d617e70f90a972185917ea0096c1ecef2bfa8b (patch)
tree9fbbcd867de9de9d0776afdd02f594ba312c46eb /src/nostr.h
Bitflash: fair-launch release
Satoshi's bitcoin-0.1.0 reborn with RandomX CPU proof of work, anonymous .btf addressing over Nostr with CGNAT rendezvous, automatic peer discovery, a headless Linux node, and Windows GUI wallet. Fair launch, no premine, 21M cap.
Diffstat (limited to 'src/nostr.h')
-rw-r--r--src/nostr.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/nostr.h b/src/nostr.h
new file mode 100644
index 0000000..5ec9f65
--- /dev/null
+++ b/src/nostr.h
@@ -0,0 +1,39 @@
1// Copyright (c) 2026 Bitflash developers
2// Distributed under the MIT/X11 software license.
3//
4// Peer discovery over Nostr relays -- replaces the old ThreadIRCSeed. Each
5// node publishes a replaceable event (NIP-78, kind 30078) containing its
6// "ip:port", signed with Schnorr/secp256k1 (BIP340, the same scheme used by
7// Nostr), and subscribes to receive the announcements of other nodes, feeding
8// them into the Bitflash address manager.
9
10#ifndef BITFLASH_NOSTR_H
11#define BITFLASH_NOSTR_H
12
13#include <string>
14
15// Thread entry point (signature compatible with _beginthread)
16void ThreadNostrSeed(void* parg);
17
18// Public relays used for discovery. Tunable.
19extern const char* pszNostrRelays[];
20extern const int nNostrRelays;
21
22// Rendezvous meeting relay ("host:port") this node registers at and advertises
23// in its .btf descriptor. Overridable with /rvrelay=host:port.
24extern std::string strBtfMeetingRelay;
25
26// Copy this node's .btf identity (lazily loading or generating it): the x-only
27// pubkey (= the .btf address) and the x25519 secret for the end-to-end channel.
28bool BtfGetIdentity(unsigned char pubkey[32], unsigned char enc_sk[32]);
29
30// This node's printable .btf address, or "" if the identity failed to load.
31std::string BtfLocalAddress();
32
33// Resolve a .btf address via the public discovery relays: fetch the owner's
34// self-certified descriptor and return its meeting node ("host:port") and
35// x25519 public key for the end-to-end channel.
36bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort,
37 unsigned char enc_pub[32]);
38
39#endif