<p>Rusty Russell discussed lnprototest (<a href="https://github.com/rustyrussell/lnprototest" rel="nofollow noreferrer">repo link</a>) during the August 2020 <a href="https://diyhpl.us/wiki/transcripts/sydney-bitcoin-meetup/2020-08-25-socratic-seminar/" rel="nofollow noreferrer">Sydney Socratic Seminar</a>.</p>
<p>What is lnprototest exactly?</p>
<blockquote>
<p>It is a pure Python3 test system and some packages to interface with
the spec that currently live in the c-lightning repository. You run
lnprototest and it has these scripts that go “I will send this” and
you will send back this. It can keep state and does some quite
sophisticated things. It has a whole heap of scaffolding to understand
commitment transactions, anchor outputs and a whole heap of other
things. Then you write these scripts that say “If I send this it
should send this” or “If I send this instead…”. You create this DAG, a
graph of possible things that could happen and it runs through all of
them and checks that happens.</p>
</blockquote>
<p>Can it be used to test an individual Lightning implementation or just interoperability between implementations?</p>
<blockquote>
<p>It is really good for protocol development too not just testing
existing stuff. When you want to modify the spec you can write that
half and run it against your own node.</p>
</blockquote>
<p>Since writing this answer a <a href="https://github.com/ElementsProject/lightning/pull/4444" rel="nofollow noreferrer">PR</a> in the c-lightning repo from Lisa Neigut was merged to run lnprototest with every c-lightning CI build.</p>
<p>What does an implementation need to do to use lnprototest?</p>
<blockquote>
<p>They need their own runner. Take the c-lightning one, it fires up a
bitcoind in regtest mode and fires up a c-lightning node. It is kind
of dumb. You have to have c-lightning run in developer mode because it
uses some weird hacks. We are slowly pulling those out. Ideally you’d
be able to run it in any off the shelf implementation. You have to get
your hands dirty a bit and write some Python for your implementation,
that is true.</p>
</blockquote>

CC BY-SA 4.0
2021-03-22T19:39:38.497Z
2021-07-15T14:13:29.173Z
2021-07-15T14:13:29.173Z
Michael Folkson
<p>What is <a href="https://medium.com/blockstream/announcing-the-lnprototest-alpha-release-f43f46f2c05" rel="nofollow noreferrer">lnprototest</a> exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations? What does an implementation need to do to use lnprototest?</p>

<core-lightning><testing><lightning-rfc>
What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations?
Michael Folkson
# What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations?

(Asked by: username_0 on 2021-03-22)

What is [lnprototest](https://medium.com/blockstream/announcing-the-lnprototest-alpha-release-f43f46f2c05) exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations? What does an implementation need to do to use lnprototest?

**Tags:** core-lightning, testing, lightning-rfc


---

## 1 answers

### Answer by username_0 on 2021-03-22. Score: 2 | Accepted answer

Rusty Russell discussed lnprototest ([repo link](https://github.com/rustyrussell/lnprototest)) during the August 2020 [Sydney Socratic Seminar](https://diyhpl.us/wiki/transcripts/sydney-bitcoin-meetup/2020-08-25-socratic-seminar/).

What is lnprototest exactly?

> It is a pure Python3 test system and some packages to interface with
> the spec that currently live in the c-lightning repository. You run
> lnprototest and it has these scripts that go “I will send this” and
> you will send back this. It can keep state and does some quite
> sophisticated things. It has a whole heap of scaffolding to understand
> commitment transactions, anchor outputs and a whole heap of other
> things. Then you write these scripts that say “If I send this it
> should send this” or “If I send this instead…”. You create this DAG, a
> graph of possible things that could happen and it runs through all of
> them and checks that happens.

Can it be used to test an individual Lightning implementation or just interoperability between implementations?

> It is really good for protocol development too not just testing
> existing stuff. When you want to modify the spec you can write that
> half and run it against your own node.

Since writing this answer a [PR](https://github.com/ElementsProject/lightning/pull/4444) in the c-lightning repo from Lisa Neigut was merged to run lnprototest with every c-lightning CI build.

What does an implementation need to do to use lnprototest?

> They need their own runner. Take the c-lightning one, it fires up a
> bitcoind in regtest mode and fires up a c-lightning node. It is kind
> of dumb. You have to have c-lightning run in developer mode because it
> uses some weird hacks. We are slowly pulling those out. Ideally you’d
> be able to run it in any off the shelf implementation. You have to get
> your hands dirty a bit and write some Python for your implementation,
> that is true.


---

