Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.67 KB

89.md

File metadata and controls

62 lines (46 loc) · 2.67 KB

NIP-89

Bitcoin Transaction Broadcasting Events

draft optional author:benthecarman

A special event with kind 28333, that contains an encoded bitcoin transaction. The bitcoin transaction is encoded as a base64 string, and is contained in the content field.

The network magic is contained in the tags field. This is to identify the network that the transaction is for. The common ones are:

  • mainnet: f9beb4d9
  • testnet: 0b110907
  • signet (default): 0a03cf40
  • regtest: fabfb5da

If another value is present it is likely a custom signet.

This is an ephemeral event, and is not stored on the server. So relays or other custom clients could receive these events, and broadcast them to the bitcoin network.

For example:

{
  "kind": 28333,
  "content": "AgAAAAABAtkXo8t2LfqIwQ+BPQg/LZdqAtAb61bY0zIjFvvxMTtGAAAAAAD9////j8wvOaFL5Dz+0CTKXNKxxv1GrusMps3aodsXQGp95xgAAAAAAP3///8CLAPTBQAAAAAiUSBIKoy1/JK1GdfWhii8KLfBooZg3qT7ImuwwwC6t2eT6oiKAQAAAAAAIlEgZtFI4Bx2rDqBe4X9+lzEhh7Kxca3tNE9l/QfH/ZghQECRzBEAiBV2O5+jskV8/H+UuzgRuku2gCAwlmErieXrS5scbongAIgLWD6uN8BGpyE7gNtX4jxnkNShY8yjhdcjhsHR4RAWJEBIQLlCnhSR+K9YoAngUWj94mptHhcVYJGi+rT3lwApIekkQJHMEQCIDwrK0YHftZ2BQsBjHdJb89Tlpzvc3z8E1wGgbqIVRBQAiB6J0UXuPjib+geVmaZeoq4vYD+fDz835o5OJRg9ITFDAEhA1oq2Zj0d4XbATjc3OUSXSJDvvIosDeAsHyegwk4fkcTNAslAA==",
  "tags": [
    [
      "magic",
      "0b110907"
    ]
  ],
  ...other fields
}

Uses

This offers a way for users to broadcast bitcoin transactions in a private way without having to connect to the bitcoin network directly.

Today, users have to connect to the bitcoin network directly or use an api like mempool.space to broadcast transactions. This is not private, as you can leak your ip address to the service or a bitcoin node.

Nostr provides a better opportunity for users to broadcast transactions in a private way. Nostr relays are at most bitcoin adjacent and have a much lower risk of being run by a chain analysis company, thus providing a possibly better way to broadcast transactions.

Recommendations

Clients should generate an ephemeral keypair for each transaction they want to broadcast. This keypair should only ever be used for broadcasting that transaction. This is to best preserve the privacy of the user and to not link any extra metadata to the transaction.

Obviously, the user should avoid broadcasting the channel to a relay run by a chain analysis company to prevent IP leaks. To prevent this, they should try to broadcast to a minimal amount of relays to prevent the chance of broadcasting to a malicious relay. This is a tradeoff between privacy and reliability as your transaction has a lower chance of being broadcasted if you broadcast to less relays.