diff --git a/docs/1.0.md b/docs/1.0.md
index a590fd0..bbf6dc7 100644
--- a/docs/1.0.md
+++ b/docs/1.0.md
@@ -830,8 +830,8 @@ and what it is capable of.
belongs to the `customKey`.
- **type** (required) A slug that represents the type of receiving address that will receive the payment.
- **address** (required) This denotes the receiving address of the payee.
- - **split** (required) The number of shares of the payment this recipient will receive.
- - **fee** (optional) If this attribute is not specified, it is assumed to be false.
+ - **split** (required) If `fee=false`, the number of shares for the recipient; if `fee=true`, the percentage of the payment that the recipient will receive.
+ - **fee** (optional) Indicates whether the recipient should instead receive a percentage amount off the top of each payment. If this attribute is not specified, it is assumed to be false.
### Examples
```xml
@@ -840,19 +840,19 @@ and what it is capable of.
name="Alice (Podcaster)"
type="node"
address="02d5c1bf8b940dc9cadca86d1b0a3c37fbe39cee4c7e839e33bef9174531d27f52"
- split="40"
+ split="45"
/>
```
-
-
## Medium
``
diff --git a/value/value.md b/value/value.md
index d60e8e0..51e3ecf 100644
--- a/value/value.md
+++ b/value/value.md
@@ -9,8 +9,7 @@
## Purpose
Here we describe an additional "block" of XML that gives podcasters (and other media creators) a way to receive direct
-payments from their audience in response to the action of viewing or listening to a created work. Utilizing so called "
-Layer 2"
+payments from their audience in response to the action of viewing or listening to a created work. Utilizing so called "Layer-2"
cryptocurrency networks like Lightning, and possibly other digital currency mechanisms, near real-time micropayments can
be directly sent from listener or viewer to the creator without the need for a payment processor or other "middle men".
@@ -25,18 +24,19 @@ the use of fiat currency, if there is an API that is capable of interfacing as a
## Play to Pay
This system can be thought of as Play-to-pay, rather than the traditional Pay-to-play paywall approach. When a
-media listener (such as within a podcast app) presses the play button on an episode who's feed contains a value
+media listener (such as within a podcast app) presses the play button on an episode whose feed contains a value
block, a compatible app will be expected to begin streaming micro-payments to the designated recipients on a time
interval that makes sense for the app. The amount of each payment can be any amount the listener chooses, including
-zero. If the listener chooses not to pay to listen to this media, then the app can ignore the value block of that feed.
+zero. Alternatively, the listener can send one-time payments (referred to as "boosts" in this document).
+If the listener chooses not to pay to listen to this media, then the app can ignore the value block of that feed.
## Payment Intervals
-The "time interval" for calculating payments is **always 1 minute**. However, the actual interval between when payments
+The "time interval" for calculating streaming payments is **always 1 minute**. However, the actual interval between when payments
are sent can be longer. The interval should be chosen with a few factors in mind such as connectivity (is the app
-currently on-line?), transaction fees (batch payments together to reduce fee percentage), cryptocurrency network load
+currently online?), transaction fees (batch payments together to reduce fee percentage), cryptocurrency network load
(can the given crypto network or API support this payment rate?).
No matter what the chosen time interval for the actual transaction, the calculation should be done on a once-per-minute
@@ -54,8 +54,8 @@ that make up the total runtime of the content, thus all payment calculations are
## Elements
-There are two elements that make up what we refer to as the "value block". They are a parent element that specifies the
-currency to use, and one or more child elements that specify who to pay using the currency and protocol described by the
+There are two elements that make up what we refer to as the "value block". They are a parent element (``) that specifies the
+currency to use, and one or more child elements (``) that specify who to pay using the currency and protocol described by the
parent.
@@ -95,17 +95,17 @@ This element can exist at either the `` or `- ` level.
#### Explanation:
-Using Lightning as an example, the `type` would be "lightning". Various possible `type` values will be kept
+Using Lightning as an example, the `type` would be `"lightning"`. Various possible `type` values will be kept
in a slug list [here](valueslugs.txt). This is the only type currently in active use. Others are under development
and will be added to the list as they see some measure of adoption, or at least a working example to prove viability.
The `method` attribute is used to indicate a sub-protocol to use within the given `type`. Again, returning to
-Lightning as an example, the `method` would be "keysend". Normally, a Lightning payment requires an invoice
-to be generated by the payee in order to fulfill a transaction. The "keysend" protocol of Lightning allows payments
+Lightning as an example, the `method` would be `"keysend"`. Normally, a Lightning payment requires an invoice
+to be generated by the payee in order to fulfill a transaction. The `"keysend"` protocol of Lightning allows payments
to be streamed to what is, essentially, an open invoice. Other cryptocurrencies may have a similar protocol that
-would be used here. If not, a value of "default" should be given.
+would be used here. If not, a value of `"default"` should be given.
-The "suggested" amount is just that. It's a suggestion, and must be changeable by the user to another value, or
+The `"suggested"` amount is just that. It's a suggestion, and must be changeable by the user to another value, or
to zero. The suggested amount depends on the payment protocol being used. For instance, with Lightning on the Bitcoin
network, the amount can be as low as one millisatoshi, expressed as `0.00000000001` BTC.
@@ -172,8 +172,8 @@ There is no limit on how many `valueRecipient` elements can be present in a give
the `customKey`.
- `type` (required) A slug that represents the type of receiving address that will receive the payment.
- `address` (required) This denotes the receiving address of the payee.
-- `split` (required) The number of shares of the payment this recipient will receive.
-- `fee` (optional) If this attribute is not specified, it is assumed to be false.
+- `split` (required) If `fee=false`, the number of shares for the recipient; if `fee=true`, the percentage of the payment that the recipient will receive.
+- `fee` (optional) Indicates whether the recipient should instead receive a percentage amount off the top of each payment. If this attribute is not specified, it is assumed to be false.
@@ -185,7 +185,7 @@ simple like
podcaster
chooses to donate a percentage of their incoming funds to a charity.
-The `type` denotes what type of receiving entity this is. For instance, with lightning this would typically be "node".
+The `type` denotes what type of receiving entity this is. For instance, with lightning this would typically be `"node"`.
This would
indicate that the `address` attribute for this recipient is a Lightning node that is capable of directly receiving
incoming keysend payments. Valid values for
@@ -196,23 +196,17 @@ Payments must be sent to a valid destination which is given in the `address` att
depending on
the underlying currency being used.
-The `split` attribute denotes an amount of "shares" of the total payment that the recipient will receive when each timed
-payment is made.
-When a single `` is present, it should be assumed that the `split` for that recipient is 100%,
-and the "split" should
-be ignored. When multiple recipients are present, a share calculation (see below) should be made to determine how much
-to send to each recipient's address.
+The meaning of `split` depends on the value of `fee`:
+- When `fee=true`, `split` denotes the percent value that should be taken off each transaction for the recipient.
+- When `fee=false`, `split` denotes the number of "shares" for the recipient—splits among non-fee recipients represent the ratios in which the remaining amount (*after* the `fee=true` recipients receive their payments) must be distributed.
-The `fee` attribute tells apps whether this split should be treated as a "fee", or a normal split. If this attribute is
-true, then this split should be calculated
-as a fee, meaning its percentage (as calculated from the shares) should be taken off the top of the entire transaction
-amount. This is the preferred way for service
-providers such as apps, hosting companies, API's and third-party value add providers to add their fee to a value block.
+`fee=true` is the preferred way for service providers such as apps, hosting companies, APIs, and third-party value-add providers to add their fee to a value block.
+Because when `fee=true`, `split` represents *percentage* value, the sum of splits for `fee=true` recipients cannot exceed 100.
#### Custom Key/Value Pairs
The `customKey` and `customValue` pair can be used (especially for the Lighning Network) to help a receiving application
-route or process payments that have all arrived at one node.
+route or process payments that have all arrived at a single node.
The idea is that Podcast Index will parse and store and all client apps will always send a `customKey:customValue` pair
if these are found in the Value Block.
@@ -231,29 +225,41 @@ the player to your app, and for which nothing already exists, add your own.
### Payment calculation
-The interval payment calculation is:
+When all combined, together the recipients will receive
+```
+(Batch payout) = (Listener payment) * (Interval count)
+```
+
+`Listener payment` and `Interval count` refer to one of the following scenarios:
+- `Listener payment` is either the amount of a one-time payment made by the listener (with `Interval count` usually being 1)
+- or `Listener payment` is the amount being streamed per-minute by the listener (with `Interval count` referring to the interval in minutes at which payments are sent by their client)
+
+How `Batch payout` is divided between the recipients depends on their `split` and `fee` values.
- (Number of shares / Share total) * Interval payout * Interval count
+For `fee=true` recipients $X_1, X_2, \ldots, X_m$ with splits $x_1, x_2, \ldots, x_m$ and `fee=false` recipients $Y_1, Y_2, \ldots, Y_n$ with splits $y_1, y_2, \ldots, y_n$:
-To calculate payouts, let's take the following value block as an example:
+1. Firstly, `fee=true` recipients $X_1, X_2, \ldots, X_m$ will receive $x_1\\%$, $x_2\\%$, $\ldots$, $x_m\\%$ of the total batch payout.
+2. Then, the remaining amount will be distributed among `fee=false` recipients $Y_1, Y_2, \ldots, Y_n$ in the ratio $y_1 : y_2 : \ldots : y_n$.
+
+#### Example 1: no fees, splits add up to 100
```xml
```
-This block designates three payment recipients. On each timed payment interval, the total payment will be split into 3
-smaller
-payments according to the shares listed in the split for each recipient. So, in this case, if the listener decided to
-pay 100 sats per minute for listening
-to this podcast, then once per minute the "Host" would be sent 50 sats, the "Co-Host" would be sent 40 sats and the
-"Producer" would be sent 10 sats - all to their respective lightning node addresses using the "keysend" protocol.
+This block designates three payment recipients.
+On each timed payment interval, the total payment will be split into 3 smaller payments according to the `split` of each recipient.
+Because there are no `fee=true` recipients, step 1 of the calculation can be skipped—the splits represent the ratios in which the payment should be divided.
+I.e., for recipients `A`, `B`, and `C`, the payment should be divided in the ratio $50:40:10$:
+- `A` will receive $\dfrac{50}{50 + 40 + 10} = 0.5 = 50\\%$ of the payment
+- `B` will receive $\dfrac{40}{50 + 40 + 10} = 0.4 = 40\\%$ of the payment
+- `C` will receive $\dfrac{10}{50 + 40 + 10} = 0.1 = 10\\%$ of the payment
+
+In this case, because splits add up to 100 (that is, $50 + 40 + 10 = 100$), the splits happen to correspond to the percentage values that each recipient will receive.
+However, in general, it should never be assumed or expected that splits add up to 100.
+
+Suppose that the listener chose to pay 300 sats per minute with the app sending out the payments each minute. Then:
+
+Batch payout: **300 sats**
+
+- Recipient `A` gets a payment of 150 sats (calculated using $300 \cdot \dfrac{50}{50 + 40 + 10} = 150$)
+- Recipient `B` gets a payment of 120 sats (calculated using $300 \cdot \dfrac{40}{50 + 40 + 10} = 120$)
+- Recipient `C` gets a payment of 30 sats (calculated using $300 \cdot \dfrac{10}{50 + 40 + 10} = 30$)
+
+If an app chooses to only make a payout once every 5 minutes of listening/watching, the calculation would be the same after multiplying the per-minute payment by 5:
+
+Batch payout: **1500 sats** (calculated using $5 \cdot 300 = 1500$)
+
+- Recipient `A` gets a payment of 750 sats (calculated using $1500 \cdot \dfrac{50}{50 + 40 + 10} = 750$)
+- Recipient `B` gets a payment of 600 sats (calculated using $1500 \cdot \dfrac{40}{50 + 40 + 10} = 600$)
+- Recipient `C` gets a payment of 150 sats (calculated using $1500 \cdot \dfrac{10}{50 + 40 + 10} = 150$)
+
+As shown above, the once per minute calculation does not have to actually be sent every minute.
+A longer payout period can be chosen. But, the once-per-minute nature of the payout still remains in order for listeners and creators to have an easy way to measure and calculate how much they will spend and charge.
+
+#### Example 2: no fees, splits don't add up to 100
+
+```xml
+
+
+
+
+
+
+```
+
+Again, there are no `fee=true` recipients, so step 1 of the calculation can be skipped.
+The splits represent the ratios in which the payment should be divided.
+I.e., for recipients `A`, `B`, and `C`, the payment should be divided in the ratio $100:99:1$:
+- `A` will receive $\dfrac{100}{100 + 99 + 1} = 0.5 = 50\\%$ of the payment
+- `B` will receive $\dfrac{99}{100 + 99 + 1} = 0.495 = 49.5\\%$ of the payment
+- `C` will receive $\dfrac{1}{100 + 99 + 10} = 0.005 = 0.5\\%$ of the payment
-If, instead of a 50/40/10 (total of 100) split, the splits were given as 190/152/38 (total of 380), the respective
-payment amounts each minute would still
-be 50 sats, 40 sats and 10 sats because the listener chose to pay 100 sats per minute, and the respective shares (as a
-percentage of the total) would remain the same.
+This example demonstrates why splits should not be required to add up to 100—it allows for recipients to receive payments that are not just integer percent values.
+In this specific case, it allows `B` to receive $49.5\\%$ and `C` to receive $0.5\\%$.
-On a 190/152/38 split, each minute the payment calculation would be:
+Suppose that the listener chose to send a 1000-sat boost, which the app decides to distribute immediately among the recipients:
-- Interval payout: 100 sats
+Batch payout: **1000 sats**
+
+- Recipient `A` gets a payment of 500 sats (calculated using $1000 \cdot \dfrac{100}{100 + 99 + 1} = 500$)
+- Recipient `B` gets a payment of 495 sats (calculated using $1000 \cdot \dfrac{99}{100 + 99 + 1} = 495$)
+- Recipient `C` gets a payment of 5 sats (calculated using $1000 \cdot \dfrac{1}{100 + 99 + 1} = 5$)
-- Share total: 380
+#### Example 3: recipients with `fee=true`
- - Recipient #1 gets a payment of: 50 sats (190 / 380 * 100)
- - Recipient #2 gets a payment of: 40 sats (152 / 380 * 100)
- - Recipient #3 gets a payment of: 10 sats (38 / 380 * 100)
+```xml
+
+
+
+
+
+
+
+```
-If an app chooses to only make a payout once every 30 minutes of listening/watching, the calculation would be the same
-after multiplying
-the per-minute payment by 30:
+In this case, there are two `fee=true` recipients, so the calculation will have to be done in two steps:
-- Interval payout: 3000 sats (100 * 30)
+1. `C` will receive $16\\%$ and `D` will receive $4\\%$ off the top of each payment.
+2. The rest of the payment (i.e., $100\\% - (16\\% + 4\\%) = 80\\%$) will be distributed among `A` and `B` in the ratio $101 : 99$.
-- Shares total: 380
+Suppose that the listener chose to send a 2500-sat boost, which the app decides to distribute immediately among the recipients:
- - Recipient #1 gets a payment of: 1500 sats (190 / 380 * 3000)
- - Recipient #2 gets a payment of: 1200 sats (152 / 380 * 3000)
- - Recipient #3 gets a payment of: 300 sats (38 / 380 * 3000)
+Batch payout: **2500 sats**
-As shown above, the once per minute calculation does not have to actually be sent every minute. A longer payout period
-can be chosen. But,
-the once-per-minute nature of the payout still remains in order for listeners and creators to have an easy way to
-measure and calculate how much
-they will spend and charge.
+1. `fee=true` recipients are paid first:
+ - Recipient `C` gets a payment of 400 sats (calculated using $2500 \cdot 0.16 = 400$)
+ - Recipient `D` gets a payment of 100 sats (calculated using $2500 \cdot 0.04 = 100$)
+2. After that, `fee=false` recipients get the remaining amount of 2000 sats (calculated using $2500 - (400 + 100) = 2000$):
+ - Recipient `A` gets a payment of 1010 sats (calculated using $2000 \cdot \dfrac{101}{101 + 99} = 1010$)
+ - Recipient `B` gets a payment of 990 sats (calculated using $2000 \cdot \dfrac{99}{101 + 99} = 990$)
@@ -307,11 +397,11 @@ they will spend and charge.
### Supported Currencies and Protocols
-The value block is designed to be flexible enough to handle most any cryptocurrency, and even fiat currencies with a
+The value block is designed to be flexible enough to handle any cryptocurrency, and even fiat currencies with a
given
API that exposes a compatible process.
-Currently, development is centered mostly on [Lightning](https://github.com/lightningnetwork) using the "keysend"
+Currently, development is centered mostly on [Lightning](https://github.com/lightningnetwork) using the `"keysend"`
method. Keysend allows for push
based payments without the recipient needing to generate an invoice to receive them.
Another method to send spontaneous payments via Lightning is AMP, atomic
@@ -327,8 +417,8 @@ widely implemented as of now.
For the `` tag, the following attributes MUST be used:
-- `type` (required): "lightning"
-- `method` (required): "keysend" or "amp"
+- `type` (required): `"lightning"`
+- `method` (required): `"keysend"` or `"amp"`
- `suggested` (optional): A float representing a BTC amount.
e.g. 0.00000005000 is 5 Sats.
@@ -344,7 +434,7 @@ utilized as follows:
- `type`: "node"
- `method`: "keysend" or "amp"
-- `customKey`: \
+- `customKey`: \
- `customValue`: \
- `address`: \
- `split`: \
@@ -366,8 +456,7 @@ When sending a payment containing application specific data, the client must use
This is a live, working example of a Lightning keysend value block in production. It designates four recipients for
payment - two
podcast hosts at 49 and 46 shares respectively, a producer working on per episode chapter creation who gets a 5 share,
-and
-a single share (effectively 1%) fee to the Podcastindex.org API.
+and 1% to the Podcastindex.org API.
Since the value block is defined at the `` level, it applies to every podcast episode.
```xml
@@ -419,7 +508,7 @@ payment `method` to `amp`:
```
-##### Example: `- ` Override
+##### Example: `
- ` Override
To set up different payment splits for individual episodes, a value block has to
be defined on the `
- ` level. This will override the value settings set on
@@ -514,4 +603,4 @@ payload: "stream", "boost" and "auto".
types of payments can contain textual messages (i.e. - a boostagram).
* `auto` - This means the payment was an app initiated payment that recurs at a specific long-form interval such as
weekly, monthly, yearly, etc. The user configures an interval and payment amount in the app and the app
- then sends that amount at the specified time when each interval passes.
\ No newline at end of file
+ then sends that amount at the specified time when each interval passes.