# Paymail BEEF Transaction

Deggen (<deggen@kschw.com>)

## Abstract

We specify a paymail capability extension which supports the passing of BEEF Transactions between hosts. The procedure for service discovery and requesting outputs is not detailed, rather this proposal contains only a recommendation to replace [BRC-12 RawTx](/transactions/0012.md) hex data with [BRC-62 BEEF](/transactions/0062.md) hex data.

## Motivation

We propose that [p2p destination and receive raw transaction](/payments/0028.md) functionality between hosts to include the data required for the counterparty to run SPV on the transaction.

## BRFCID

A random ID was generated in order to avoid label collisions in the capability document of a paymail server.

```yaml
brfcid: 5c55a7fdb7bb
title: Background Evaluation Extended Format Transaction
author: Darren Kellenschwiler
version: 1.0.0
```

## Specification

### Status Note

BRC-70 is a Paymail capability extension and is external to the current `bsv-blockchain/ts-sdk` / `bsv-blockchain/wallet-toolbox` BRC-100 wallet implementation. It remains useful for Paymail-specific interoperability, but current SDK/toolbox payment flows should not be expected to expose this capability unless a Paymail integration is added explicitly.

We specify that an endpoint for delivery of transaction data ought to be added to the capabilities object in the .well-known response of a paymail service with the label: `5c55a7fdb7bb`.

```json
<!-- capabilities document of the host -->
{
    "capabilities": {
        "5c55a7fdb7bb": "https://paymail.domain.tld/api/v1/beef/{alias}@{domain.tld}",
        <!-- ...others -->
    }
}
```

#### Client Request

The sender must replace the `{alias}` and `{domain.tld}` placeholders in the URI template provided by `capabilities.5c55a7fdb7bb` with a valid Paymail handle. The client must then perform a POST HTTP request with the following body:

```json
{
  "beef": "<beef_transaction_hex>", <!-- note the label is different >
  "metadata": {
    "sender": "<sender_paymail>",
    "pubkey": "<sender_public_key>",
    "signature": "<signature_of_txid>",
    "note": "<optional_human_readable_note>"
  },
  "reference": "<payment_reference>"
}
```

BEEF transaction hex is a string encoding of the binary format detailed in [BRC-62](/transactions/0062.md).

#### Server Response

The server must validate the transaction and respond with the accepted transaction ID and an optional human-readable note.

```json
{
  "txid": "<accepted_txid>",
  "note": "<optional_human_readable_note>"
}
```

### Swimlanes

A swimlanes diagram is included here for further clarification: <https://swimlanes.io/u/6J2q8QCEb>

![swimlanes](https://static.swimlanes.io/fd5ffc82e217ec5d5aeb9a8d0b5ec5e9.png)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bsv.brc.dev/payments/0070.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
