Skip to content
OmniBOLT implementation
Branch: master
Clone or download review code
Latest commit 5ff1758 Nov 12, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea htlc Cnb Oct 22, 2019
bean recode pathInfo for -4104 Nov 11, 2019
config 1009 toAddress Nov 4, 2019
dao currBlockHeight Nov 8, 2019
demo rename Sep 27, 2019
grpcpack currBlockHeight Nov 8, 2019
lightclient recode pathInfo for -4104 Nov 11, 2019
rpc currBlockHeight Nov 8, 2019
service review code Nov 12, 2019
tool review code Oct 29, 2019
LICENSE Update LICENSE Aug 8, 2019 update api doc link Oct 6, 2019
obdserver.db review code Nov 7, 2019

LightningOnOmni | OmniBOLT Daemon

LightningOnOmni implements the OmniBOLT specification, which enables Lightning network to be Omnilayer assets aware. Compile the source code and run the binary executable file, we will have an OmniBOLT deamon(OBD) providing all services for lightning network.

Table of Contents


Omnicore 0.18, which is currently in develop branch, and will be to finalize the release soon.

Omnicore 0.18 integrates the latest BTC core 0.18, which enables relative time locker used in RSM contracts and HTL contracts.


The following instruction works for Ubuntu 14.04.4 LTS, golang 1.10 or later.

step 1: fetch the source code

on your terminal:

$ git clone

or if you already set up your local git repo, you just need to fetch the latest version:

$ git pull origin master

check if all updated:

$ git remote -v
origin (fetch)
origin (push)

Step 2:

option 1: Remote Omnicore node

Use our remote OmniCore node. Go to \config\conf.ini, you will see:


This is a tesing full node for our community to run/call/test omni commands remotely. The OmniBOLT daemon invocates Omni RPC commands from this node, if you use this configuration. It is the most conveniente way to get started.

The other option uses local omnicore full node:

option 2: Local Omnicore node

Install OmniCore on your local machine. Omnicore requires a full BTC core node, which may take days to synchronize the whole BTC database to your local device. After finishing synchronization, you can run omni/BTC commands for experiments, such as constructing raw transactions or generating new addresses.

Edit the configure file: \config\conf.ini

user=your user name
pass=your password

Step 3: Compile and Run OmniBOLT Daemon

If you fail to install gRPC by go get and other gRPC related packages used in this project,try this:

$ mkdir -p $GOPATH/src/
$ cd $GOPATH/src/
$ git clone grpc
$ git clone genproto

During compilation, if you come across:

cannot find package "" in any of:
	/usr/local/go/src/ (from $GOROOT)

That's because these packages had been moved to github. Use the following commands to fix:

go to your GOPATH and:
$ cd src
$ mkdir
$ cd
$ mkdir x
$ cd x
$ git clone
$ git clone
$ git clone

Wait till all data downloaded.

$ go build obdserver.go

which generates the executable binary file obdserver under the source code directory.

if you want to generate exe file for windows platform, use this:

$ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build obdserver.go

you will see an obdserver.exe file generated under the same directory.


$ ./obdserver

The terminal displays:

2019/08/23 23:05:15 rpcclient.go:23: &{ omniwallet cB3]iL2@eZ1?cB2?}
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /ws                       --> LightningOnOmni/routers.wsClientConnect (3 handlers)

Which tells us the daemon is running. We are going to use WebSocket online testing tools to test our lightning commands.

Step 4: Test channel operations using Websocket testing tool.

Since OmniBOLT deamon(OBD) exposes WebSocket services, we use web socket test client for Chrome to do experiments. Install it from:

Make sure your browser supports WebSocket, as displayed in this screenshot.

Screenshot of Websocket online testing site

Input ws://, press Open. If on the right text pannel, displays OPENED, then we are ready to send messeages to OBD.

The first message is to login as Alice. input the following request into the Request box, and press SEND:


In the Message Log pannel, displays the response message from OBD:

{"type":1,"status":true,"sender":"alice","result":"alice login"}

It works.

Step 5: Channel Operations on test site

For the convenience of brand new users, who are willing to learn the specification and source code, we built a test site for testing OBD commands and it is for testing only. The URL is:


Open two chrom browsers, left is Alice and the right is Bob. Input URL and click OPEN, then both status will show OPENED.


1、alice login
2、bob login

create channel

Alice sends request to Bob for creating a channel between them:



OBD creats the complete message for Alice and routes it to Bob:


In Bob's browser, he will see the message, and he accepts the request, by sending the following message back:


When you test, you should replace the temporary_channel_id by the exact value that OBD generates for you.


Alice(mtu1CPCHK1yfTCwiTquSKRHcBrW2mHmfJH) deposits 0.01 to the channel (2N3vGUfBSNALGGxUo8gTYpVQAmLwjXomLhF), where fee is 0.00001, and then abtains the transaction ID:



OBD responses with the transaction script and other payloads:

		"hex":"02000000..... too long to display, you shall get your response from OBD......014eba8ac00000000",

then Alice tells Bob she created a deposit transaction:

 		"funding_tx_hex":"0200e28a6..... too long to display, you shall get your transaction hex from OBD .......a88ac00000000",

Bob replies he knows this deposit, and then OBD creates commitment transaction, revockable delivery transaction and breach remedy transaction:


OBD sends a message to both Alice and Bob, reporting the status(true or false) of all the internal transactions:


payments in a channel

Now Alice can use this channel to pay to Bob. Here are some data generated by OBD used in contructing temporary multi-sig addresses and temporary transactions of i-th commitment transaction, which will be invalidated after new(i+1) commitment transaction is created.

You shall find your corresponding temporary data within the responses of OBD:

	last_temp_pub_key: n2gj8MDzUU7JZ6eVF5VpXcL4wUfaDXzTfJ
	last_temp_private_key: cSgTisoiZLzH5vrwHBMAXLC5nvND2ffcqqDtejMg12rEVrUMeP5R
	curr_temp_address: mpnHbpARXjUBcf6vib7E3jjD6Zv4CrvYuW
	curr_temp_private_key: cP8vR19XbtytyHgyBh1SV5dVAMLrLR2rzSU9EAcQTCUHij61u5C2
	curr_temp_pub_key: 02b8302d22a50fd84f34d528ff98998a6959bc7fb8f45b5f3fb44e23101aa5d8f2

Alice sends to Bob:


then Bob replies the money is well receieved:


Remember to watch the display of Message log window, to see what OBD replies in each communication between Alice and Bob. These are usefull information when we try to debug OBD and to write real code for it.

This document is not completed yet, and will be updated during our programming.

API Document

Please visit OBD online API documentation for the lastest update.

How to Contribute

OmniBOLT Daemon is MIT licensed open source software. Hopefully you can get started by doing the above steps, but Lightning network is not that easy to develop. Anyone is welcome to join this journey, and please be nice to each other, don't bring any illegal/private stuff, abuse or racial into our community.

Please submit issues to this repo or help us with those open ones.


  • read the OmniBOLT spec. If you have any question over there, raise issues in that repo.
  • ask questions or talk about things in Issues.
  • make branches and raise pull-request, even if working on the main repository.
  • don't copy/past any code from anywhere else in contribution, because we have limited resource to compare source codes to avoid legal issues. What we can do is to read your code, run tests of your newly developed modules and read your comments in your branch to see if it is solving a real problem.
  • better running go fmt before commiting any code.
  • add test to any package you commit.
  • write/contribute light client testing tools, such as a HTML page supporting WebSocket, so that new programmers can have an intuitive experience to get started. That helps. We will release our tools for testing.

Join us in OmniBOLT slack channel

Current Features

  • Generate user OBD(OmniBOLT Daemon) address.
  • Open Poon-Dryja Channel.
  • BTC and Omni assets in funding and transaction.
  • fund and close channel.
  • Commitment Transaction within a channel.
  • List latest commitment transaction in a channel.
  • List all commmitment trsactions in a channel.
  • List all the breach remedy transactions in a channel.
  • Surveil the broadcasting commitment transactions and revockable delivery transactions.
  • Execute penelty.

Comming Features

  • HTL contracts, supported by HED, BR, RD, HT, HTRD transactions.
  • Multiple channel management for one OBD, scaling out in performance.
  • Payment across multiple channels.
  • OBD communication.
  • Light client implementation.
  • Balance and transaction history.
  • to be updated, pursuant to the development of OmniBOLT specification.

Related projects:

You can’t perform that action at this time.