gospel

module
v1.2.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: AGPL-3.0

README

Gospel: GO SPEcial Library (v1.2.33)

Copyright (c) 2011-present, Bernd Fix brf@hoi-polloi.org >Y<

Gospel is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Gospel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

SPDX-License-Identifier: AGPL3.0-or-later

Build Status Go Report Card GoDoc

Packages

  • gospel/network: Network-related functionality
    • services
    • packet handling
    • SOCKS5 connection handler
    • SMTP/POP3 mail handling
    • rate limiter
  • gospel/network/p2p:
    • P2P core library
  • gospel/network/tor:
    • Tor controller
    • hidden services (onion handling)
    • Tor utilities
  • gospel/network/tor/tools:
    • TorAuthCookie
  • gospel/bitcoin:
    • Elliptic curve crypto (Secp256k1)
    • Bitcoin addresses (and derived coins)
    • key exchange
    • hash functions (Hash160, Hash256)
    • base58 encoding
  • gospel/bitcoin/wallet:
    • HD key space
    • BIP39 seed words
  • gospel/bitcoin/script: Bitcoin script parser/interpreter
  • gospel/bitcoin/tools:
    • passphrase2seed
    • vanityaddress
  • gospel/math: Mathematical helpers
    • Fast Fourier Transformation
    • Arbitrary precision integers with chainable methods
    • k-nacci sequences
    • large integer factorization
  • gospel/crypto: cryptographic helpers
    • secret sharing
    • prime fields
    • PRNG
    • Paillier crypto scheme
    • cryptographic counters
  • gospel/crypto/ed25519:
    • general purpose Ed25519 crypto
  • gospel/logger: logging facilities
  • gospel/concurrent:
    • Signaller (signal relay)
    • Dispatcher (Workload distribution to go-routine)
  • gospel/data:
    • Marshal/Unmarshal Golang objects
    • Bloom filter
    • Generators
    • Permutations
    • S-expressions
  • gospel/parser: Read/access/write nested data structures

Install

This version (v1.2.33) is designed for the Go1.22+ release to make use of new language features.

If you only want to use the library in your projects, you don't have to install anything. Just include github.com/bfix/gospel v1.2.33 in your go.mod file and do a go mod tidy.

You can install Gospel locally if desired. Make sure that your Go environment - especially ${GOPATH} - is set up and enter the following commands:

git clone get https://github.com/bfix/gospel
cd gospel
go mod tidy

Test notes

To run the Tor-related tests you need to set some environment variables to access the Tor control port:

export TOR_CONTROL_PROTO="tcp"
export TOR_CONTROL_ENDPOINT="127.0.0.1:9051"
export TOR_CONTROL_PASSWORD="my_torcontrol_secret"
export TOR_TEST_HOST="127.0.0.1"

Only TOR_CONTROL_PASSWORD is mandatory; TOR_CONTROL_PROTO, TOR_CONTROL_ENDPOINT and TOR_TEST_HSHOST default to the above values.

If Tor is not running on localhost (127.0.0.1), but remotely (either on a separate machine or in a Docker container), the environment variables for Tor tests above need to be adjusted. Let 1.2.3.4 be the IP address of the Tor instance and 5.6.7.8 the IP address of the system running the tests. Both systems must be interconnected, so they can talk to each other. The settings in this case would look like:

export TOR_CONTROL_PROTO="tcp"
export TOR_CONTROL_ENDPOINT="1.2.3.4:9051"
export TOR_CONTROL_PASSWORD="my_torcontrol_secret"
export TOR_TEST_HOST="5.6.7.8"

N.B.: You have to make sure that host 5.6.7.8 can access the Tor control port and Tor socks proxy ports (see torrc settings on the Tor instance).

Directories

Path Synopsis
Package bitcoin implements the basic components for Bitcoin processing
Package bitcoin implements the basic components for Bitcoin processing
script
Package script handles Bitcoin scripts
Package script handles Bitcoin scripts
wallet
Package wallet handles wallets for cryptocoins
Package wallet handles wallets for cryptocoins
Package concurrent provides utilities for concurrent processing
Package concurrent provides utilities for concurrent processing
Package crypto implements custom crypto primitives
Package crypto implements custom crypto primitives
ed25519
Package ed25519 is a straight-forward implementation of Ed25519
Package ed25519 is a straight-forward implementation of Ed25519
Package data provides custom data structures
Package data provides custom data structures
Package network provides network-related utilities
Package network provides network-related utilities
p2p
Package p2p provides peer-to-peer network components
Package p2p provides peer-to-peer network components
tor
Package tor provides utilities for using the Tor network
Package tor provides utilities for using the Tor network
Package parser provides custom configuration parser
Package parser provides custom configuration parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL