<p>Lightning implementations already have implemented the functionality to watch the blockchain to see if the funding TX was spend (and the channel closed) Often this is outsourced to the Bitcoin fullnode. I suggest to look at their code base for this functionality and modify the relevant code snippet to include a watchtower solution you want to create. </p>

CC BY-SA 4.0
2019-04-11T21:50:56.530Z
Thanks Rene! It's for a class project. I am a CS student just trying to get started with lightning development. Where would you suggest to start if I want to create an alert when someone closes a channel?
Joel Davidson
CC BY-SA 4.0
2019-04-12T03:27:45.623Z
Well if you have a Bitcoin node there should be an event you it can listen to on its api if a new block is found. You can parse the block to see if it contains a transaction that spends the funding transaction of the channel. (may I ask : which class at wich university?) there are libs in almost any programming language which help you to parse the blockdata so that it should be easy to go through then and check for a spend of your funding tx
Rene Pickhardt
CC BY-SA 4.0
2019-04-12T18:11:23.200Z
I go to University of Colorado, Boulder. This semester is our university's first crypto class. It didn't really cover lightning network but I am really excited about it and am doing my project on it. Looking forward to your book on lightning.
Joel Davidson
CC BY-SA 4.0
2019-04-11T20:24:22.373Z
2019-04-11T20:24:22.373Z
Rene Pickhardt
<p>How can you listen for a transaction on a specific address? I'm working on building a lightning network watchtower and the first thing I need to do is detect when someone closes a channel.</p>

<lightning-network>
Listen for transaction on specific address
Joel Davidson
# Listen for transaction on specific address

(Asked by: username_0 on 2019-04-11)

How can you listen for a transaction on a specific address? I'm working on building a lightning network watchtower and the first thing I need to do is detect when someone closes a channel.

**Tags:** lightning-network


---

## 1 answers

### Answer by username_1 on 2019-04-11. Score: 1

Lightning implementations already have implemented the functionality to watch the blockchain to see if the funding TX was spend (and the channel closed) Often this is outsourced to the Bitcoin fullnode. I suggest to look at their code base for this functionality and modify the relevant code snippet to include a watchtower solution you want to create.

> **Comments:**
> **username_0**: Thanks username_1! It's for a class project. I am a CS student just trying to get started with lightning development. Where would you suggest to start if I want to create an alert when someone closes a channel?  
> **username_1**: Well if you have a Bitcoin node there should be an event you it can listen to on its api if a new block is found. You can parse the block to see if it contains a transaction that spends the funding transaction of the channel. (may I ask : which class at wich university?) there are libs in almost any programming language which help you to parse the blockdata so that it should be easy to go through then and check for a spend of your funding tx  
> **username_0**: I go to University of Colorado, Boulder. This semester is our university's first crypto class. It didn't really cover lightning network but I am really excited about it and am doing my project on it. Looking forward to your book on lightning.  

---

