BIP 377: Signing Message Encoding #2353

pull pythcoiner wants to merge 12 commits into bitcoin:master from pythcoiner:bip_signing changing 11 files +1531 −0
  1. pythcoiner commented at 8:38 AM on November 12, 2026: contributor

    This is a bip for signing message encoding, a byte encoding for the messages a coordinator and an external signer exchange: get info, get keys, descriptor registration, address verification and signing.

    Mailing list post: https://groups.google.com/g/bitcoindev/c/gmHOr6JRJyU/m/kkWnI_NAAgAJ Delving post: https://delvingbitcoin.org/t/qr-based-signing-flow-payloads-in-miniscript-context/2464

  2. pythcoiner force-pushed on Nov 12, 2026
  3. pythcoiner marked this as ready for review on Nov 12, 2026
  4. murchandamus added the label New BIP on Nov 13, 2026
  5. jonatack commented at 9:26 PM on November 16, 2026: member

    Looks complete. Seems to fill a real gap, provided hardware-wallet vendors would be interested to adopt it.

  6. jonatack added the label Needs number assignment on Nov 16, 2026
  7. in bip-signing.md:89 in 383f7c7c7e
      84 | +`FINGERPRINT`: 4 bytes, the BIP-32 master key fingerprint.
      85 | +
      86 | +`EXTENDED_KEY`: 78 bytes, the BIP-32 serialization of an extended public or private
      87 | +key (4 version + 1 depth + 4 parent fingerprint + 4 child number + 32 chain code +
      88 | +33 key). A private key carries `0x00` followed by its 32-byte key in place of the
      89 | +33-byte public key, and its own version bytes, so both have the same length.
    


    danielabrozzoni commented at 4:46 PM on November 18, 2026:

    What do you mean by "and its own version bytes"? It's tripping me up a little bit. I thought you were saying "the private key has 0x00 + the 32 byte key, so it's the same length as the 33 bytes public key", what does the version have with it?


    pythcoiner commented at 1:32 AM on November 20, 2026:

    it was about the bip32 version: https://github.com/bitcoin/bips/blob/a7f91321f25b5be8d93e901775621c21519e80b7/bip-0032.mediawiki?plain=1#L131

    but i dropped the capability to export private key, it's purpose was to allow using bip352 with a signer, but after talking with @notTanveer we both agree it does not feel right to allow exporting a private key only for that purpose, it's a big footgun from the external signer POV, I guess the right way to do is rather to use a SP private scan key generated from an public key exported from the external signer

  8. in bip-signing.md:163 in 383f7c7c7e
     158 | +| `FLAG` | Pre-release       |
     159 | ++--------+-------------------+
     160 | +| 0x00   | Stable (final)    |
     161 | +| 0x01   | Alpha             |
     162 | +| 0x02   | Beta              |
     163 | +| 0x03   | Release candidate |
    


    danielabrozzoni commented at 5:05 PM on November 18, 2026:

    Usually release candidates carry a number too - rc1 vs rc2 etc, this should be specified too


    pythcoiner commented at 1:33 AM on November 20, 2026:

    added a byte to carry the rc number

  9. in bip-signing.md:153 in 383f7c7c7e
     148 | +
     149 | +`MODEL`: `STRING`, the device model.
     150 | +
     151 | +`VERSION`: in a response body, 8 bytes of device firmware version, `MAJOR` `MINOR`
     152 | +`PATCH` `FLAG` (the message's protocol `VERSION` is defined under Encoding). `MAJOR`
     153 | +and `MINOR` are 2-byte big-endian unsigned integers, `PATCH` is a 3-byte big-endian
    


    danielabrozzoni commented at 5:05 PM on November 18, 2026:

    Why are you reserving 3 bytes for patch? I can understand 2 bytes for major/minor (1 byte is 0-255 and might not be enough), but 2 seem enough for patch too...


    pythcoiner commented at 1:34 AM on November 20, 2026:

    my bad, I think my initial intent was to reserve a byte for the rc number, fixed

  10. in bip-signing.md:230 in 383f7c7c7e
     225 | +`ERROR` `0x0F` (unsupported operation), e.g. a Taproot miniscript descriptor without
     226 | +bit 3, a silent payment send without bit 4, a silent payment spend without bit 5, an
     227 | +Unregister Descriptor request without bit 6, or a `musig()` key without bit 7. A
     228 | +`FORM` that needs a capability the signer does not advertise, such as `FORM` `0x01`
     229 | +without bit 0 or `FORM` `0x03` without bit 5, is the exception: it gets `ERROR`
     230 | +`0x06` (see Error response body).
    


    danielabrozzoni commented at 5:07 PM on November 18, 2026:

    This should link to the "Error response" paragraph below

    (Both here and in the other 3 places with the same sentence)


    pythcoiner commented at 1:35 AM on November 20, 2026:

    done

  11. in bip-signing.md:196 in 383f7c7c7e
     191 | +in any request carrying a `DESCRIPTOR_BODY`. A signer MUST set the bit of each form
     192 | +it takes, so a coordinator picks the form before it sends one: a BIP-388 wallet
     193 | +policy always converts to a BIP-380 descriptor, while a descriptor converts to a
     194 | +wallet policy only when it fits BIP-388's restrictions.
     195 | +
     196 | +A signer taking bit 0 or bit 1 handles the basic descriptors whatever its other
    


    danielabrozzoni commented at 5:15 PM on November 18, 2026:

    "taking" and "whatever" read a bit weird here, I would say:

    A signer that sets bit 0 or bit 1 handles the basic descriptors regardless of its other bits: ...


    pythcoiner commented at 1:35 AM on November 20, 2026:

    done

  12. in bip-signing.md:151 in 383f7c7c7e
     146 | +
     147 | +`VENDOR`: `STRING`, the device vendor.
     148 | +
     149 | +`MODEL`: `STRING`, the device model.
     150 | +
     151 | +`VERSION`: in a response body, 8 bytes of device firmware version, `MAJOR` `MINOR`
    


    danielabrozzoni commented at 5:19 PM on November 18, 2026:

    I think this should be called FW_VERSION, DEVICE_VERSION, or equivalent, so when reading the BIP we don't confuse it with the protocol version specified below


    pythcoiner commented at 1:36 AM on November 20, 2026:

    right, renamed to FW_VERSION

  13. danielabrozzoni commented at 5:57 PM on November 18, 2026: member

    Reviewed 383f7c7c7e6c1f2afdfbd1260610d7c07e09050b - I gave a first read and left a few ideas.

    I think the BIP is well specified, but sometimes the reading order isn't very helpful to the reader, sometimes terms are used but then specified only later (one example: POR is used on L212 but specified on L506).

    What do you think of adding an overview section, to give a high level explanation of the BIP, before jumping into the specification?

    I asked claude to generate one, I think is a good start (but please double check that it's correct, and rewrite/remove any part you don't like): https://github.com/danielabrozzoni/bips/commit/729ac8a298fa41c5bb7f1d55a030dfeeebe0ae39

  14. jonatack removed the label Needs number assignment on Nov 19, 2026
  15. jonatack renamed this:
    BIP draft: Signing message encoding
    BIP 377: Signing Message Encoding
    on Nov 19, 2026
  16. jonatack commented at 7:27 PM on November 19, 2026: member

    Assigned 377. Please update (also have a look at the review feedback), rename the files, and add a README entry.

  17. pythcoiner commented at 1:37 AM on November 20, 2026: contributor

    @danielabrozzoni thanks for the review, I think all your comments are addressed @jonatack thanks for the bip #, I think everything is up to date now

  18. bip signing 8c3048c25d
  19. bip-signing: add the unsupported operation (0x0F) and network mismatch (0x10) error codes cf1aa042cb
  20. bip-signing: answer a request the signer cannot read with TYPE 0x00 and REQUEST_ID 0x0000 7f8c0d6257
  21. bip-signing: DERIV is the path under the descriptor, a FORM the signer cannot take is refused with 0x06, an SP sighash other than ALL with 0x0A 5246b9b0a8
  22. bip-signing: Unregister Descriptor request, TYPE 0x07 e3f92e7368
  23. bip-signing: capability bits for forms, SP accounts and unregister 7e0e66b7f5
  24. bip-signing: require BIP-376 for silent payment spends dd5c41c5fd
  25. bip-0377: assign number 377, rename the files, add the README entry 35873c9a2e
  26. bip-0377: drop the private key export 89dce4c5e6
  27. bip-0377: FLAG carries the pre-release number, PATCH is 2 bytes bd7a5e87d8
  28. bip-0377: link the error response body and reword the descriptor form bits 61526ffbfd
  29. bip-0377: add an Overview section d68f1686c4
  30. pythcoiner force-pushed on Nov 20, 2026
  31. pythcoiner commented at 2:01 AM on November 20, 2026: contributor

    rebased on master

  32. pythcoiner referenced this in commit c4bf5de799 on Nov 20, 2026
  33. craigraw commented at 11:46 AM on November 23, 2026: contributor

    The Motivation opens with "No standard defines the messages a coordinator exchanges with an external signer." I don't think that holds, and the BIP has no prior art or related work section to support it.

    Blockchain Commons has worked on this problem for years. The UR encoding (BCR-2020-005) and its type registry (BCR-2020-006) define crypto-psbt, crypto-hdkey, crypto-account and crypto-output. These are widely used today for exchanging keys, descriptors and PSBTs between airgapped coordinators and signers. Beyond the data types, BCR-2021-001 defined explicit request/response messages: derive a key at a keypath, sign a PSBT, return a descriptor against a challenge. It has since been superseded by envelope-based requests and responses (GSTP, BCR-2023-014). Within the BIPs, BIP 129 (BSMS) standardises the key and descriptor exchange for multisig setup, which overlaps directly with Register Descriptor. BIP 391 was a previous attempt at a binary descriptor encoding that positioned itself against the BCR formats.

    I think this BIP covers real gaps that none of these address. Registering a descriptor on a signer that can't store it, verifying addresses, and handling wallet policies, MuSig2 and silent payments are all new, as is returning just the signatures rather than the whole PSBT. But the case for it should come from comparing it with what exists, not from saying nothing exists.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-24 00:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me