interledgerjs / btp-packet

Packet parser for Bilateral Transfer Protocol
1 stars 3 forks source link

feat: add BTP optimistic transfer type #18

Closed sharafian closed 6 years ago

sharafian commented 6 years ago

For https://github.com/interledger/rfcs/issues/359

michielbdejong commented 6 years ago

I think Prepare and Fulfill together make up sendData, and the payment channel claim, which travels in the protocolData of the Response to the Fulfill, makes up sendMoney.

sharafian commented 6 years ago

True, those are theoretically equivalent, but it seems strange to say that the first function call is made up of a Request/Response and Request, but then takes no action until a second function is called, thus releasing the final response.

I think it's more elegant to say sendData does a Request/Response containing only data (TYPE_MESSAGE), and then sendMoney does a Request/Response (TYPE_TRANSFER).

Although thinking about it it's still not perfect; the fact that there's no association to tie those two operations together is a little bit inconvenient for writing the implementation