diff --git a/encrypted-psbt-fragments.md b/encrypted-psbt-fragments.md new file mode 100644 index 0000000..ce25c96 --- /dev/null +++ b/encrypted-psbt-fragments.md @@ -0,0 +1,116 @@ + + + +# Encrypted PSBT Fragments + +## Abstract + +This document specifies a method for encoding HPKE-encrypted messages within PSBT proprietary fields. Participants in multi-party transaction construction protocols use this mechanism to exchange authenticated, confidential, arbitrary-length application messages alongside the transaction data they are jointly building, without introducing a communication channel outside PSBT itself. + +## Rationale + +PSBT fields are visible to every participant who receives the PSBT. Multi-party construction protocols require this for the transaction data itself to be jointly readable but not for all application-layer messages. Coordination messages such as payment acknowledgments are often intended for a single recipient or a subset of the participant set, and must remain confidential from the rest. + +Encrypting these messages and carrying them in PSBT proprietary fields lets participants reuse the existing PSBT exchange as the transport, instead of standing up a separate authenticated channel and new data formats. This preserves the property that a single PSBT round-trip carries everything needed to advance the protocol. + + + +## Specification + +### Using Proprietary Fields + +Callers MUST use proprietary field in either the input, output or global map `0xFC`. + +The keydata will include the RFC9180 cipher suite ids (if we support multiple ciphersuites see below). // TODO: this will identify this field has a hpke message. + +Valuedata must include `enc` (the encapsulated ephemeral key) and the ciphertext(s). + +Encrypted messages are encoded as PSBT proprietary fields (PSBT_*_PROPRIETARY, type 0xFC), scoped to the global, input, or output map depending on which part of the transaction the message pertains to. + +A single logical message occupies exactly one proprietary field. A sender addressing multiple recipients encrypts and encodes the message separately for each, producing one field per recipient. + +Participants must optimistically attempt to decrypt each field to identify their own. + + + +### Versioning and Type + + + +### HPKE + +#### Specifying cipher suite + + + +#### Info + + +#### Key sharing + + + +#### Auth mode + + + + + +### Privacy Considerations + +_ + +#### Message Padding + + + + + + +#### BIP324 ElligatorSwift + +Encode the HPKE encap'd public keys such that other participants the cannot detect a raw curve point. + + + + +## Flow Diagram + + +## Reference Implementation and Test vectors + +TODO +