You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
馃 Claude Fable 5.1 responding on behalf of bennyhodl
Problem
#188 gives ddk-manager a build-then-commit seam for every outgoing DLC message: send_offer, accept_contract_offer, and on_accept_message return the message, and commit_offer, commit_accept, and commit_sign copy the final message's TLV stream onto the stored contract. An application that talks to the manager directly can attach its own records.
An application that uses the ddk crate cannot. DlcDevKit::send_dlc_offer and DlcDevKit::accept_dlc_offer push the manager's message straight to the transport with no step in between, and the memory transport replies with the sign message from inside on_dlc_message. So the rule that every send path lets the application attach records holds in ddk-manager but not one layer up.
Proposal
DlcDevKit needs an offer builder. send_dlc_offer takes either a ContractInput, as today, or a builder that owns the offer message before it goes out. The builder is where the application appends its TLV records. The same shape applies to accept and sign, so each of the three send paths has one place where the application finishes the message before the transport sees it.
send_dlc_offer(input | builder, counter_party, announcements): build, let the application finish, commit, send.
accept_dlc_offer(contract_id | builder): same.
Sign: the reply is built inside on_dlc_message, so the seam is a hook the transport loop calls before it sends the reply, or on_dlc_message returns the reply and the loop commits then sends.
Acceptance
An application using only the ddk crate can attach a record to an offer, an accept, and a sign, and the stored contract carries the same stream as the wire.
The existing ContractInput call sites keep working unchanged.
plans/custom-tlv-stream.md records that the ddk crate send path is covered.
Note
馃 Claude Fable 5.1 responding on behalf of bennyhodl
Problem
#188 gives
ddk-managera build-then-commit seam for every outgoing DLC message:send_offer,accept_contract_offer, andon_accept_messagereturn the message, andcommit_offer,commit_accept, andcommit_signcopy the final message's TLV stream onto the stored contract. An application that talks to the manager directly can attach its own records.An application that uses the
ddkcrate cannot.DlcDevKit::send_dlc_offerandDlcDevKit::accept_dlc_offerpush the manager's message straight to the transport with no step in between, and the memory transport replies with the sign message from insideon_dlc_message. So the rule that every send path lets the application attach records holds inddk-managerbut not one layer up.Proposal
DlcDevKitneeds an offer builder.send_dlc_offertakes either aContractInput, as today, or a builder that owns the offer message before it goes out. The builder is where the application appends its TLV records. The same shape applies to accept and sign, so each of the three send paths has one place where the application finishes the message before the transport sees it.send_dlc_offer(input | builder, counter_party, announcements): build, let the application finish, commit, send.accept_dlc_offer(contract_id | builder): same.on_dlc_message, so the seam is a hook the transport loop calls before it sends the reply, oron_dlc_messagereturns the reply and the loop commits then sends.Acceptance
ddkcrate can attach a record to an offer, an accept, and a sign, and the stored contract carries the same stream as the wire.ContractInputcall sites keep working unchanged.plans/custom-tlv-stream.mdrecords that theddkcrate send path is covered.Related: #188, #190