Skip to content

blip-tap.md needs updating to match the protocols actually used by tapd #1446

@ZZiigguurraatt

Description

@ZZiigguurraatt

Using this issue to collect errors and omissions in blip-tap.md that need to be fixed to match what tapd actually does.

For starters, TLV types don't match blip-tap.md. For example, we have

type (
// HtlcAmountRecordType is a type alias for the TLV type that is used to
// encode an asset ID and amount list within the custom records of an
// HTLC record on the wire.
HtlcAmountRecordType = tlv.TlvType65536
// HtlcRfqIDType is the type alias for the TLV type that is used to
// encode an RFQ id within the custom records of an HTLC record on the
// wire.
HtlcRfqIDType = tlv.TlvType65538
)

but these numbers don't match those defined at

https://github.com/Roasbeef/blips/blob/579061b962e0212edf6977fd3138522e43897105/blip-tap.md?plain=1#L335-L371 .

I think we also have an issue here

type (
// HtlcAmountRecordType is a type alias for the TLV type that is used to
// encode an asset ID and amount list within the custom records of an
// HTLC record on the wire.
HtlcAmountRecordType = tlv.TlvType65536
// HtlcSigsRecordType is a type alias for the TLV type that is used to
// encode the signatures of an HTLC record on the wire.
HtlcSigsRecordType = tlv.TlvType65537
// HtlcRfqIDType is the type alias for the TLV type that is used to
// encode an RFQ id within the custom records of an HTLC record on the
// wire.
HtlcRfqIDType = tlv.TlvType65538
// BtcKeyShutdownType is the type alias for the TLV type that is used to
// encode the BTC internal key of the shutdown record on the wire.
BtcKeyShutdownType = tlv.TlvType65539
// AssetKeyShutdownType is the type alias for the TLV type that is used
// to encode the asset internal key of the shutdown record on the wire.
AssetKeyShutdownType = tlv.TlvType65540
// ScriptKeysShutdownType is the type alias for the TLV type that is
// used to encode the script keys of the shutdown record on the wire.
ScriptKeysShutdownType = tlv.TlvType65541
// ProofDeliveryAddrShutdownType is the type alias for the TLV type that
// is used to encode the proof delivery address of the shutdown record
// on the wire.
ProofDeliveryAddrShutdownType = tlv.TlvType65542
)
.

I'm not sure where else in the code TLV values are used that we could have similar problems.

I think it likely makes sense to update blip-tap.md and not the code, but I'm not the one to make that decision. I think we need to fix something though because it is hard to understand the code if values don't match the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bLIPdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions