The scalability of the blockchain is the important thing to processing large transactions. Presently, Bitcoin community can obtain as much as 7 TPS, and Qtum community can at the moment obtain ten occasions that of Bitcoin, however it’s nonetheless not sufficient for large transactions. (eg: in e-commerce software eventualities, in Alibaba Double Eleven Buying Competition lately, peak transactions of Alipay community exceeded 100,000 TPS; Visa achieved 47,000 TPS throughout the 2013 vacation). With a view to clear up the efficiency and storage issues attributable to such large transactions, Joseph Poon proposed the Lightning Community resolution, which is a decentralized system that may notice a real-time and big transaction community with out trusting the opposite celebration and third events. The essential concept is that the 2 events within the transaction create a fee channel via the transaction script on the chain. After that, the real-time and big fee transactions of the 2 events are accomplished off the chain. By linking a number of channels, any two friends within the community can carry out fund transaction and full the worth switch with out the necessity to belief third events for fund custody and settlement. These transfers might be made alongside the supply path via sensible contracts between untrusted events.
Eclair is a lightning community implementation on the Bitcoin blockchain, which at the moment helps features together with the creation of fee channels and receipt of funds for Lightning Networks. Qtum has applied Qtum Eclair based mostly on Eclair, which permits features reminiscent of channel creation, real-time transaction, and small transactions on Qtum. The next are some checks of the lightning community’s options on the Qtum Testnet.
Step 1 — Set up and run the Qtum Core pockets
Qtum Eclair requires a synchronized, non-pruned Qtum Core pockets that helps segwit, zeromq, switch, and transaction indexing. Qtum Eclair will use any Qtum it finds within the Qtum Core pockets to pay for any lightning community channels that you simply select to open. When the channel is closed, the remaining Qtum within the channel will probably be refunded to the Qtum Core pockets. You possibly can configure the Qtum Core pockets to make use of the p2sh-segwit handle or bech32 handle, and Qtum Eclair is appropriate with each modes.
Right here is the obtain handle of the core pockets : https://github.com/qtumproject/qtum/releases, choose the obtain bundle in accordance with your working system and structure.
Create and edit the configuration file qtum.conf as follows:
It’s beneficial to change rpcuser and rpcpassword within the configuration file for sake of safety.
For Linux, the trail of qtum.conf is ~/.qtum/qtum.conf
For Mac OSX, the trail of qtum.conf is ~/Library/Utility Assist/Qtum/qtum.conf
For Home windows, the trail of qtum.conf is %APPDATApercentQtumqtum.conf
Run the Qtum Core pockets, and ship a specific amount of testnet cash to the pockets after the block is synchronized.
Qtum testnet cash might be claimed at http://testnet-faucet.qtum.info/.
Step 2 — Set up Qtum Eclair
2.1 Set up JDK and Maven
Qtum Eclair is developed utilizing the Scala language. To run Qtum Eclair, you could first set up the JDK, and OpenJDK 11 or above is beneficial.
For Linux, apt-get set up default-jdk
For Mac OSX, brew cask set up adoptopenjdk
For Home windows, obtain the installer at https://jdk.java.net/archive/.
You additionally want to put in Maven, which you’ll be able to obtain at http://maven.apache.org/download.cgi.
Run command mvn -v, and a return as follows signifies that the set up is profitable.
2.2 Compile Qtum Eclair
mvn set up -DskipTests
2.Three Run Qtum Eclair
Create and edit the configuration file ~/.qtum-eclair/eclair.conf as follows:
Chain = “testnet” // “mainnet” for mainnet, “testnet” for testnet, “regtest” for regtest
Public-ips = 
Binding-ip = “0.0.0.0”
Port = 9735
Enabled = false
Binding-ip = “127.0.0.1”
Port = 8080
Password = “qtum-eclair”
Use-old-api = false
Watcher-type = “bitcoind”
Host = “localhost”
Rpcport = 13889
Bitdir = “”
Rpcuser = “foo”
Rpcpassword = “bar”
Zmqblock = “tcp://127.0.0.1:29000”
Zmqtx = “tcp://127.0.0.1:29000”
1 = 1200000
2 = 1000000
6 = 800000
12 = 600000
36 = 500000
72 = 410000
Min-feerate = 400
Easy-feerate-window = 6 // 1 = no smoothing
Node-alias = “qtum-eclair”
Node-color = “49daaa”
World-features = “”
Native-features = “8a”
Override-features = 
Channel-flags = 1
Mud-limit-satoshis = 72800
Max-htlc-value-in-flight-msat = 500000000000 // 5 QTUM
Htlc-minimum-msat = 1
Max-accepted-htlcs = 30
Reserve-to-funding-ratio = 0.01
Max-reserve-to-funding-ratio = 0.05
To-remote-delay-blocks = 3600
Max-to-local-delay-blocks = 10080
Mindepth-blocks = 3
Expiry-delta-blocks = 720
Price-base-msat = 400000
Price-proportional-millionths = 100
Max-feerate-mismatch = 1.56
Replace-fee_min-diff-ratio = 0.1
Revocation-timeout = 20 seconds
Ping-interval = 30 seconds
Ping-timeout = 10 seconds
Ping-disconnect = true
Auto-reconnect = true
Fee-handler = “native”
Fee-request-expiry = 1 hour
Min-funding-satoshis = 1000000 // 0.01 Qtum
Max-payment-attempts = 5
Autoprobe-count = 0
Randomize-route-selection = true
Channel-exclude-duration = 60 seconds
Broadcast-interval = 60 seconds
Init-timeout = 5 minutes
Max-route-length = 6
Max-cltv = 5040
Price-threshold-sat = 8400
Max-fee-pct = 0.03
Heuristics-enable = true
Ratio-cltv = 0.15
Ratio-channel-age = 0.35
Ratio-channel-capacity = 0.5
// don’t edit or transfer this part
Mailbox-type = “akka.dispatch.BoundedMailbox”
Mailbox-capacity = 1
Mailbox-push-timeout-time = 0
Executor = “thread-pool-executor”
Kind = PinnedDispatcher
The public-ips within the above configuration file is an array of the general public IP of the native machine, and rpcuser and rpcpassword ought to be modified accordingly.
Begin the consumer with the command java -jar ./eclair-node-gui/goal/lightning-capsule.jar
Create a lightning community channel
Proper-click the decrease left nook of the native Qtum Eclair consumer and choose “Copy URI” to get its node handle.
Click on the “Channel” button within the higher left nook and choose “Open Channel”.
Within the pop-up web page, fill within the URI of the channel accomplice, and the capability of the channel, which is about to 10 QTUM for instance. Click on “Join” to create the channel. At this level, it’s essential to wait for six blocks to verify the transaction and the channel will probably be created efficiently.
Lightning Community Fee
As soon as the channel is about up, you should utilize the Lightning Community for micropayments.
Click on the “Channel” button within the higher left nook, choose “Obtain Fee”, fill within the receipt quantity within the pop-up web page, click on the “Generate” button to get your personal receipt handle. Right here we select a really small quantity of 1 Satoshi, which is equal to 0.00000001 QTUM. Such a small transferred quantity is unimaginable with out utilizing a lightning community.
Click on the “Channel” button within the higher left nook, choose “Ship Fee”, fill within the different celebration’s lightning community receipt handle and quantity within the pop-up web page, and click on the “Ship” button, then you possibly can switch tokens to the opposite celebration.
After the switch is accomplished, the quantity of the 2 events’ modifications instantaneously. As a result of it is a pure transaction off the chain, there is no such thing as a want to attend for the block affirmation, and it is freed from charges.
Shut the channel for settlement
The channel might be closed when the channel is not wanted.
Click on the “Shut” button to shut the channel.
As soon as closed, the remaining QTUM within the channel will probably be refunded to the respective Qtum Core pockets.
Fast deployment of Qtum Eclair companies on the server utilizing Docker
The above is a graphical interface tutorial for abnormal customers. If you wish to deploy Qtum lightning community nodes on the server, you possibly can confer with this part for fast deployment.
sudo docker pull qtum/qtum:newest
vim /decide/qtum/qtum.conf, and enter the next configuration data:
sudo docker run -tid — rm -v “/decide/qtum:/root/.qtum” — title qtum qtum/qtum:newest qtumd — testnet
test the block sync progress with sudo docker exec -ti qtum qtum-cli — testnet getblockchaininfo and look ahead to the block to be absolutely synchronized
vim /decide/qtum-eclair/eclair.conf, enter the configuration data within the third part, and change localhost and 127.0.0.1 with qtumhost beneath bitcoind
sudo docker construct -t qtum-eclair-img .
sudo docker run -ti — rm — title qtum-eclair -v “/decide/qtum-eclair:/information” -p 9735:9735 — hyperlink qtum:qtumhost -e “JAVA_OPTS=-Declair.printToConsole” qtum- Eclair-img
Lightning Community Nodes on Qtum Testnet for testing
Listed below are two public Qtum lightning community nodes on Qtum testnet,
URI: 030[email protected]22.214.171.124:13415
URI: 02b[email protected]126.96.36.199:13435
You possibly can set up lightning community channels with these nodes for micropayment testing.
By means of the above checks, we will be taught that the Qtum-based lightning community can notice real-time transactions and settlement off the chain. For transactions concerned solely two events, they’re freed from cost, making it potential to make small fee, for instance. In idea, by establishing a lot of lightning community channels and inserting transactions off the Qtum chain, it’s potential to course of large transactions in actual time.
We are going to publish extra documentation and checks report lately, please keep tuned.