Documentation
¶
Overview ¶
Package seqnet defines the Sequentia network parameters for the go-elements address / blinding / PSET machinery used by the daemon.
Sequentia is an Elements 23.x fork, so the transaction, confidential-asset and PSETv2 formats are inherited unchanged; only the network parameters differ from Liquid. Addresses are deliberately Bitcoin-identical (same base58 version bytes and bech32 HRPs as Bitcoin main/test/regtest); the Sequentia-specific bit is the confidential (blech32) HRP — "sqb" on mainnet, "tsqb" on testnet.
The native/policy asset is derived from each network's genesis and is therefore NOT a compile-time constant: it is supplied at runtime (read from the ocean wallet's GetInfo.nativeAsset, which the wallet itself reads from the node's getsidechaininfo.pegged_asset) and left empty here.
This mirrors wallet/pkg/seqnet but additionally maps the daemon's ocean-wallet network signal: the ocean adapter stringifies the ocean.v1 GetInfoResponse network enum to "mainnet"/"testnet"/"regtest" (NOT the Sequentia names), so ByName accepts both spellings.
Index ¶
- Constants
- Variables
- func ByName(name string) (network.Network, bool)
- func IsConfidential(addr string, net *network.Network) (bool, error)
- func ToConfidential(info *AddressInfo, net *network.Network) (string, error)
- func ToOutputScript(addr string, net *network.Network) ([]byte, error)
- type AddressInfo
Constants ¶
const ( Mainnet = "sequentia" Testnet = "sequentia-testnet" Regtest = "sequentia-regtest" )
Network name keys.
Variables ¶
var SequentiaMainnet = network.Network{ Name: Mainnet, Bech32: "bc", Blech32: "sqb", HDPublicKey: [4]byte{0x04, 0x88, 0xb2, 0x1e}, HDPrivateKey: [4]byte{0x04, 0x88, 0xad, 0xe4}, PubKeyHash: 0, ScriptHash: 5, Wif: 0x80, Confidential: 12, AssetID: "", }
SequentiaMainnet — Bitcoin-identical base58/bech32, confidential HRP "sqb".
var SequentiaRegtest = network.Network{ Name: Regtest, Bech32: "bcrt", Blech32: "bcrt", HDPublicKey: [4]byte{0x04, 0x35, 0x87, 0xcf}, HDPrivateKey: [4]byte{0x04, 0x35, 0x83, 0x94}, PubKeyHash: 111, ScriptHash: 196, Wif: 0xef, Confidential: 4, AssetID: "", }
SequentiaRegtest — Bitcoin-regtest-identical; blech32 == bech32 ("bcrt").
var SequentiaTestnet = network.Network{ Name: Testnet, Bech32: "tb", Blech32: "tsqb", HDPublicKey: [4]byte{0x04, 0x35, 0x87, 0xcf}, HDPrivateKey: [4]byte{0x04, 0x35, 0x83, 0x94}, PubKeyHash: 111, ScriptHash: 196, Wif: 0xef, Confidential: 70, AssetID: "", }
SequentiaTestnet — Bitcoin-testnet-identical base58/bech32, confidential HRP "tsqb".
Functions ¶
func ByName ¶
ByName returns a COPY of the network matching the given signal and whether it is known. Callers that set AssetID (from the wallet's native asset) get an isolated value, never mutating the shared definition.
func IsConfidential ¶
IsConfidential reports whether the given address is a confidential Sequentia address. It is the network-aware replacement for address.IsConfidential.
func ToConfidential ¶
func ToConfidential(info *AddressInfo, net *network.Network) (string, error)
ToConfidential builds a confidential Sequentia address from an unconfidential address and a blinding public key. It is the network-aware replacement for address.ToConfidential.
Types ¶
type AddressInfo ¶
AddressInfo mirrors address.AddressInfo: the unconfidential address, its output script and (for confidential addresses) the blinding public key.
func FromAny ¶
func FromAny(addr string, net *network.Network) (*AddressInfo, error)
FromAny decodes a confidential OR transparent Sequentia address into its output script, with the blinding key present only for the confidential form. Sequentia is transparent by default: a wallet account derives bech32 addresses unless asked for blinded ones, and a decoder that only understood the blinded form returned nil for every transparent address the maker's own account handed it.
func FromConfidential ¶
func FromConfidential(addr string, net *network.Network) (*AddressInfo, error)
FromConfidential decodes a confidential Sequentia address into its blinding public key and the output script of the embedded unconfidential address. It is the network-aware replacement for address.FromConfidential.