Download the PHP package nova-carnivore/bolt12-php without Composer

On this page you can find all versions of the php package nova-carnivore/bolt12-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bolt12-php

bolt12-php

PHP Version CI PHPStan Level Latest Version

Modern PHP 8.3+ BOLT 12 Lightning Network offer/invoice encoder/decoder with BIP-340 Schnorr signatures. Full spec compliance, production-ready.

Features

Installation

Requirements

Quick Start

Decode (Auto-detect Type)

Encode an Offer

Encode an Invoice Request (auto-signed)

Encode an Invoice (auto-signed)

Verify Signatures

Invoice Errors

Full Payment Flow Example

API Reference

Decoder::decode(string $bolt12String): Offer|InvoiceRequest|Invoice

Decodes any BOLT 12 bech32 string (auto-detects type by prefix).

Decoder::decodeInvoiceError(array $bytes): InvoiceError

Decodes a BOLT 12 Invoice Error from raw TLV bytes.

Encoder::encodeOffer(...): string

Encodes a BOLT 12 Offer (lno1...). Not signed per spec.

Encoder::encodeInvoiceRequest(...): string

Encodes and signs a BOLT 12 Invoice Request (lnr1...).

Encoder::encodeInvoice(...): string

Encodes and signs a BOLT 12 Invoice (lni1...).

Encoder::encodeInvoiceError(...): array

Encodes a BOLT 12 Invoice Error as raw TLV bytes.

Signer::verifyInvoiceRequest(InvoiceRequest $invReq): bool

Verifies a BIP-340 Schnorr signature on an invoice request.

Signer::verifyInvoice(Invoice $invoice): bool

Verifies a BIP-340 Schnorr signature on an invoice.

Signer::getPublicKey(string $privateKeyHex): string

Derives a compressed public key from a private key.

Data Classes

Class Description
Offer Decoded offer with all fields as readonly properties
InvoiceRequest Decoded invoice request with signature
Invoice Decoded invoice with paths, payinfo, and signature
InvoiceError Decoded invoice error
BlindedPath Blinded path with hops
BlindedPayInfo Payment info for blinded paths
FallbackAddress On-chain fallback address
OnionMessageHop Single hop in a blinded path
Bip353Name BIP-353 name (user@domain)
TlvEntry Raw TLV type-value pair

BOLT 12 Spec Coverage

Message Types

Type Prefix Encode Decode Sign Verify
Offer lno ✅* ✅*
Invoice Request lnr
Invoice lni
Invoice Error N/A N/A

* Offers are optionally signed per spec

TLV Fields

Type Field Offer InvReq Invoice
0 invreq_metadata
2 offer_chains
4 offer_metadata
6 offer_currency
8 offer_amount
10 offer_description
12 offer_features
14 offer_absolute_expiry
16 offer_paths
18 offer_issuer
20 offer_quantity_max
22 offer_issuer_id
80 invreq_chain
82 invreq_amount
84 invreq_features
86 invreq_quantity
88 invreq_payer_id
89 invreq_payer_note
90 invreq_paths
91 invreq_bip_353_name
160 invoice_paths
162 invoice_blindedpay
164 invoice_created_at
166 invoice_relative_expiry
168 invoice_payment_hash
170 invoice_amount
172 invoice_fallbacks
174 invoice_features
176 invoice_node_id
240 signature ✅*

Encoding

Cryptography

Security

Exception Handling

Development

Architecture

Key Differences from BOLT 11

Feature BOLT 11 BOLT 12
Encoding Bech32 with checksum Bech32 without checksum
Crypto ECDSA recovery BIP-340 Schnorr
Signatures Simple message hash Merkle tree construction
TLV encoding 5-bit continuation BigSize encoding
Message types 1 (invoice only) 4 (offer, invreq, invoice, error)
Privacy Direct node ID Blinded paths

License

MIT — see LICENSE.


All versions of bolt12-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-gmp Version *
paragonie/ecc Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nova-carnivore/bolt12-php contains the following files

Loading the files please wait ...