DataSig -- Data signatures over Lightning



Summary:

The DataSig spec aims to propose the format of a structure representing a signature over arbitrary data being transmitted over the Lightning Network (over HTLC custom records). The spec's main goal is to assist with data verification independently of what medium one chooses for data transmission. The DataSig structure is placed inside a custom TLV record, and it allows the receiving end to validate that data were authored by the source node and meant to be received by the receiving node. To instantiate a DataSig signing the data `D`, one needs to follow six steps, including populating the version field with the version that is going to be used, signing the byte array `AD`, generating a signature encoded in fixed-size LN wire format, and encoding the resulting DataSig structure to wire format (byte array `S`). Assuming that the destination node has retrieved the byte array of the data `D` and the byte array of the encoded signature struct `S`, the data should be verified against the signature by following the procedure outlined in the spec. The scope of this spec is to deal with the verification of the author and intended recipient of transmitted data. However, it does not intend to solve the issue of associating a DataSig to the corresponding data (signed by it), in case they are not transmitted in pairs. For now, it assumes that data and signature are transmitted over an HTLC's custom records in pairs. The formatted version of the document can be found on hackmd, and the use-case is already being used by a few projects such as Sphinx Chat, Whatsat, and Balance of Satoshis.


Updated on: 2023-06-03T09:03:46.646691+00:00