...was built for the Bolt-A-Thon 2 hackathon on December 6th, 7th and 8th, 2019. Watch the hackathon submission video.
This project was also re-spun as Onion Studio to use new features of the Lightning Network nodes to pass data for similar drawing.
The rectangle area above this text and beside this text are pixel grids where you may draw pixels via sending special messages in-band via the Lightning Network. The images will update with the drawings in real-time on this page via websocket.
These drawing spaces can be placed like banner ads on your website, such that you can earn satoshis from people that want to set content for your web visitors to see. BannerPunk is open source software and a server can be run with your own Lightning Network node for your own website.
Here is another banner image space, but of the type you typically see that is inline in an article's text body
The banner images on this page can be drawn to by paying our node (inbound channels appreciated). However it needs to be done in a special way, but don't worry, we wrote scripts for C-Lightning and LND to make it easy. More documentation is in the README.md, The content of .pngs can be drawn (at a cost of 1 satoshi per pixel, plus any routing fees) like so:
$ ./lnd-draw.py png /path/to/lncli image_no x_offset y_offset /path/to/source/image.png
$ ./c-lightning-draw.py png /path/to/lightning-rpc image_no x_offset y_offset /path/to/source/image.png
The top banner ad space is 256 pixels wide and 60 pixels tall with a 3x3 dot size. When writing it is addressable as image number 0
The side banner ad space is 60 pixels wide and 256 pixels tall with a 3x3 dot size. When writing it is addressable as image number 1
The inline article space is 256 pixels wide and 256 pixels tall with a 1x1 dot size. When writing it is addressable as image number 2
These scripts have software dependencies, so please read the documentation.
To draw without the use of the scripts, three things must be done:
Up to four pixels can be encoded in a 256-bit payment preimage. pixel_preimage.py provides classes to help with encoding and decoding these values.
Typically, you might think of Lightning Network payment forwarding as looking like this:
This will work for BannerPunk, however this is not how our example scripts (C-Lightning and LND) operate. This scenario is not ideal because it requires coordination between Alice and Carol to set up and trigger.
Instead, the easiest way to draw is via setting up a circular payment where Alice pays her own invoice via a route she choses to include the target BannerPunk node.
This enables Alice to set all the parameters and trigger the payment herself without needing to coordinate.
Using/abusing the preimage this way to carry a message payload has disadvantages. Using the upcoming TLV message payload functionality would be an improvement, however that is not in widespread support yet.
The pixel-encoding preimage is also visible by all parties involved in the route. It would be better if it was encrypted as a shared secret between the payer and the BannerPunk target node. Perhaps using a scheme like this