Connect with us


Plugging into C-Lightning: The Future of Lightning Plugins Is Bright



Trying to navigate the different Lightning implementations can be a challenge. Although there were initially three implementations: c-lightning, eclair and lnd, more continue to come out of the woodwork all the time with ptarmigan, rust-lightning and Electrum the most recent to enter the fray.

Often, it seems developers and aspiring developers choose to use or contribute to a particular implementation based on the language it is written in. Familiar with Scala? Choose eclair. Excited by the potential of Rust? Choose rust-lightning. However, there are other key considerations such as the aims, design philosophies, use cases and trade offs of the different implementations. In addition, just because an implementation is written in a certain language doesn’t necessarily mean that you are required to code in that language to contribute to the ecosystem around that implementation.

The emerging contrasts between the lnd and rust-lightning implementations were explored on a panel at Breaking Bitcoin 2019 and in this Bitcoin Magazine article. Whilst lnd seeks to take the load off developers and provide ultimate functionality out of the box, rust-lightning seeks to offer ultimate flexibility with developers encouraged to bring their own components and slot them in. 

In contrast, c-lightning offers a third way. It maintains a robust and secure core that is designed to not be tweaked or replaced by the developer. Flexibility and additional functionality is available through the use of plugins that can be written by the developer in various languages such as Python or Go. The aim is for the c-lightning ecosystem to emerge as a testbed for experimenting with new cutting edge features, previously the terrain of other implementations such as lnd and eclair, without sacrificing the performance and robustness of the core.

Plugins are subprocesses that are started by the main lightningd daemon. They work in cooperation with lightningd. Any plugins that are surplus to requirements do not need to be run. Some plugins do need certain hooks to be introduced into lightningd that will notify the plugins about internal events and/or alter the behavior of lightningd.

The First C-Lightning Plugins

Blockstream has a series of Medium blog posts to showcase some of the first plugins written by the c-lightning team. These include the “Summary” plugin which provides a summary of node status including satoshis onchain, what that amounts to in fiat terms, number of peers, number of channels, how balanced are they, etc. 

The “Probe” plugin determines whether there is a route to make a payment to a certain node in the network, returns the fee level required and indicates which channel(s) are preventing a successful payment. This can be used to prepare the groundwork for a future payment or merely to explore the topology of the network. 

The “Prometheus” plugin collects data on the performance of your node to provide visualizations and alerts. With all of these plugins you could choose to contribute to the plugin by adding a feature or building your own from scratch.

Community Plugins

In total there are 16 “community curated” plugins for c-lightning available at the time of writing. These include an autopilot plugin ported from a library built by Rene Pickhardt. Autopilots decide which nodes to open channels with on behalf of the user. The user needs to tell the autopilot the percentage of funds under their control, the number of channels to be opened and the minimum channel size. The autopilot also needs to be notified by lightningd when channels are opened and closed by remote parties. Building an effective autopilot is challenging as user preferences, such as maximizing the probability of a successful payment, can conflict with network health, such as the level of decentralization. 

There is also a rebalance plugin, which moves liquidity between the user’s channels to ensure there is sufficient incoming and outgoing liquidity; and an invoiceless payment plugin, which allows a user to make a payment without first receiving an invoice. When running c-lightning you can choose to turn on or off any combination of these plugins.

As Lisa Neigut (@niftynei) said in her tweetstorm, c-lightning doesn’t provide “a standardized HTTP accessible interface out of the box nor an authentication scheme” for third-party app developers like lnd does. But community-built plugins offer the opportunity to build equivalents for c-lightning that exist in other implementations. 

Kristaps Kaupe has started a GitHub repo for plugins emulating some lnd commands. Other plugin authors worth highlighting are Richard Bondi, who has written a collection of plugins in Go, including a plugin to ban peers; fiatjaf, who has written a plugin implementing LN URL to help the payer interact with the payee; and Conor Scott, who has written a number of plugins in Python including a plugin to create channels with top capacity nodes. Finally, Justin Moon has built a proof-of-concept plugin to fund Lightning channels with hardware wallets.

The Challenges of Plugins

Although this plugin architecture seems to offer the best of both worlds, it does present some challenges and potential downsides. It is not clear at this stage whether the ultimate flexibility of rust-lightning will mean it is better suited for existing Bitcoin wallets seeking to integrate Lightning into their existing codebase.

In addition, as the number of community plugins multiply and the value of Bitcoin relying on these plugins increases, security and curation are going to be critical. There will inevitably be duplication and overlap between plugins. 

Curation is challenging because it effectively recommends (unofficially, caveat emptor) which plugins should be used and which shouldn’t. Without curation, it becomes impossible for users and developers to get started quickly without examining all of the competing plugins. There is an argument that some languages (and some developers!) are better suited to writing security-critical software. However, the particularly dangerous JSON-RPC methods can only be installed with the developer option and are only intended for testing and debugging with the assistance of the c-lightning team. There is also guidance available on the dangers a plugin developer might incur when taking advantage of a particular hook that can change the default behavior of c-lightning.

It is not the case that this approach creates a perfectly permissionless environment for developers, as some future plugins will still require additional hooks to be merged into the c-lightning codebase by the c-lightning team. For example, a hook to facilitate a watchtower plugin is in discussion at the time of writing. It is possible that some hooks won’t be merged due to security concerns or implementation details.

It remains to be seen whether instances of c-lightning nodes running different sets of plugins cause compatibility issues between c-lightning nodes or with other implementations. It is already challenging to ensure compatibility between different implementations, assuming c-lightning nodes are all running the same release. Experimentation is important, though, and lessons from this experimentation will prove invaluable when finalizing the BOLT specifications for the Lightning protocol.

London Bitcoin Devs

The opportunity to build and play around with new plugins in a wide selection of different languages is drawing developers into building on top of c-lightning. Antoine Poinsot (@darosior) came to London to present at the London Bitcoin Devs meetup in March 2020. Poinsot is developing a plugin manager called Reckless which will offer a selection of plugins to the user and start the chosen plugins dynamically. He has also built an RPC command hook which allows a plugin to take over any RPC command and change it. This is potentially reckless and experimental as RPC commands are how users interact with lightningd. If RPC commands can be accepted, rejected or changed it opens up a number of use cases but also possibilities for users to lose their funds.

This RPC command hook formed the basis of Rusty Russell’s most recent presentation at the online Boltathon 2. There is still a whole swathe of plugins that could be built from trampoline routing to HODL invoices, and Christian Decker expects “There’s already a plugin that does that” to become a meme. In that case, Decker and the c-lightning community may just have their work cut out curating this emerging jungle of plugins.

Thanks to Antoine Poinsot and Christian Decker for their contributions to this article.

The post Plugging into C-Lightning: The Future of Lightning Plugins Is Bright appeared first on Bitcoin Magazine.



There Are Now Over 10,000 Bitcoin ATMs Throughout the World

The number of bitcoin ATMs installed throughout the world has exceeded 10,000, and the United States continue to lead the rest of the world in crypto ATMs with 76% of machines installed. According to CoinATMRadar, the first Bitcoin ATM was installed back in 2013 and in seven years the industry grew to over 10,000 machines […]



The number of bitcoin ATMs installed throughout the world has exceeded 10,000, and the United States continue to lead the rest of the world in crypto ATMs with 76% of machines installed.

According to CoinATMRadar, the first Bitcoin ATM was installed back in 2013 and in seven years the industry grew to over 10,000 machines installed. In comparison, bank ATMs needed nine years to get to 10,000 machines back in the 1970s.

CoinATMRadar writes that after only 3.5 years the number of crypto ATMs grew to 1,000, and that over the next 3.5 years the number surged by 9,000. The first bitocin ATM was installed in Vancouver at the Waves Coffee House, and there is still a machine there.

Source: CoinATMRadar

The idea of a Bitcoin ATM came ot be, according to CoinATMRadar, as entrepreneurs were looking for ways to make bitocin easily available to people, and the general populace was already familiar with ATMs. Companies started working on the project and in 2013 the first one was installed in Canada.

In 2014, the first Bitcoin ATM was installed in the U.S., in Albuquerque, New Mexico, and since then most crypto ATMs have been installed in the country. By 2015, there were only 300 Bitcoin ATMs throughout the world, being installed by small organizations trying to bolster crypto adoption.

CoinATMRadar adds that bitcoin initially dominated crypto ATMs, with only 4% of machines supported an altcoin: litecoin. In 2017, however, the BTC network was congested and transaction fees and confirmation times surged. The firm added:

This resulted in worse UX when transactions started getting stuck and users of ATMs needed to reach support to get it resolved.

It’s worth noting that in 2017 the price of bitcoin hit its near $20,000 all-time high, and as the network was clogged users started using other cryptoassets. ATM operators followed users and started adding support for cryptocurrencies like ETH, LTC, DASH, and others. Nevertheless, around 30% of all crypto ATMs only support Bitcoin transactions.

Featured image via Unsplash.

Continue Reading


NFT Sales Heat Up as Rarible Marketplace Passes $5M in Volume

While decentralized finance (DeFi) has grabbed most of the recent headlines, the non-fungible token (NFT) market has quietly picked up steam over the summer.  According to a Sept. 16 report from crypto asset data website Messari, Rarible, an NFT marketplace, has passed $5 million in sales so far this month—more than quadrupling sales numbers from August. […]

The post NFT Sales Heat Up as Rarible Marketplace Passes $5M in Volume appeared first on BeInCrypto.



While decentralized finance (DeFi) has grabbed most of the recent headlines, the non-fungible token (NFT) market has quietly picked up steam over the summer.

According to a Sept. 16 report from crypto asset data website Messari, Rarible, an NFT marketplace, has passed $5 million in sales so far this month—more than quadrupling sales numbers from August. The report also noted that $1.5 million of this new volume came on a single day, on Sept. 14.

Rarible is a place where you can create, buy, and sell digital collectibles and, as such, is the beneficiary of surging NFT popularity, driven mostly by digital art. On Sept. 21, the news of a record-breaking digital art NFT sale was announced, with a piece called “Right Place & Right Time” selling for more than $100,000.

art NFTart NFT
Source: PR Newswire

Rarible’s numbers, and the general buzz surrounding digital art, have caught the attention of a few big names in crypto. Morgan Creek Digital co-founders Anthony Pompliano and Jason Williams have reportedly made a “big bet” on digital art.

As outlined in Pompliano’s daily newsletter, the bet is based on the idea that digital art will become bigger than traditional art, a market that has had a cap of “$65 billion for the last few years.” By comparison, digital art’s current market cap is around $10 million.

Never one to shy away from a controversial stance, Pompliano went on to state, “my confidence level that we see a future 6,000x increase in the digital art market cap is fairly high.” Because of this, “we [Pompliano and Williams] plan to invest heavily in the space over the coming months and years” he said.

Others, however, were slightly less bullish. The CEO of crypto derivatives exchange FTX and Alameda Research, Sam Bankman-Fried, tweeted a more skeptical take.

The tweet prompted a debate over the value of art, the ease with which “unique” digital art can be copied, and the future NFTs may or may not have.

Adam Back, the well-known cryptographer and founder of Hashcash, chimed in, encouraging Bankman-Fried to consider buying digital art NFTs as art patronage, “you could photocopy it, but then you’re not a patron.”

Digital art is, of course, just one piece of the NFT pie. The fantasy soccer game Sorare, which allows players to collect “limited edition digital collectibles” while also managing a team, has also seen an increase—recording sales of around $750,000 this month, almost half its all-time total.


Continue Reading


Iran to Provide Crypto Miners With More Electricity Subsidies



The Iranian government has continued its crusade to support the country’s fledging crypto mining space. In its latest show of help, Tehran has announced a program that will allow miners to access a significant surplus of energy.

A Great Time to be an Iranian Crypto Miner

According to reports from local news media, the Iranian Thermal Power Plant Holding Company (TPPH) has announced a plan to provide three power plants’ electricity output to miners in the country. The program, which will be conducted after a tender, improves miners’ access to one of their most fundamental resources, thus improving their overhead efficiency.

Mohsen Tarztalab, the agency’s head noted that the country’s struggling economy had been a concern for the government. It now seeks to create an enabling work environment that will benefit companies and provide employment opportunities. The country’s electricity has also seen a significant gap between revenues and expenses, and the government sees crypto mining as a means to improve revenues and provide income for the state.

However, the initiative comes with a condition, as miners will only be able to get the output from expansion turbines in plants. According to Tarztalab, this process won’t include any consumption of liquid fuels. By using just natural gas, the government is hoping to make the process as green as possible.

Tarztalab noted that the expansion turbines are independent and don’t participate in the national grid’s electricity production process. So, the government will be able to conduct this electricity transfer without necessarily affecting the country’s electricity production capacity.

A Structured Mining Industry Yields Results

So far, Iran has done a laudable job of legitimizing the crypto mining industry and providing an enabling environment for players. So far, the process has yielded some positive results. In July, local media house Mehr News Agency reported that the Ministry of Industry, Mine, and Trade had issued 14 mining licenses to foreign companies, as investments in the country continued to surge.

Iran’s mining license requirement began earlier this year, as Vice President Es’haq Jahangiri issued a directive to that effect. To get a license, miners would need to disclose information on their officials, the mining equipment they use, and the size of their operations. A report from the country’s Banking and Economic System Reference Media (IBENA) back in January confirmed that over a thousand companies already got their licenses.

Another incentive for registered miners is a reduced power rate, with Mehr News Agency reporting that miners are now getting charged as low as $0.11per kilowatt-hour (kWh). For peak summer season (June to September), however, they will have to pay $0.46 per kWh.

The government has also set up a process that rewards citizens for blowing the lid on illegal mining facilities. Last month, Tavanir, the state power company, announced that it had shut down 1,100 of such criminal outfits already. Per reports, every whistleblower gets a 100 million rial ($480) reward for their help.


Continue Reading