From 2b3e83342f197f275a0231b352d7f46fef1cfe06 Mon Sep 17 00:00:00 2001 From: Jonas Lundqvist Date: Wed, 3 Oct 2018 22:33:30 +0200 Subject: [PATCH 1/3] Unconfirmed tx is not in the blockchain By definition an unconfirmed transaction is not in the blockchain. It might be in the mempool though. --- specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification.md b/specification.md index 8297337..d22b84a 100644 --- a/specification.md +++ b/specification.md @@ -316,7 +316,7 @@ This invoice is no longer accepting payments | 400 | The amount on the transaction (X BTC) does not match the amount requested (Y BTC). This payment will not be accepted. | Payout amount to address does not match amount that was requested | | 400 | Transaction fee (X sat/kb) is below the current minimum threshold (Y sat/kb) | Your fee must be at least the amount sent in the payment request as `requiredFeePerByte`| | 400 | This invoice is priced in BTC, not BCH. Please try with a BTC wallet instead | Your transaction currency did not match the one on the invoice | -| 422 | One or more input transactions for your transaction were not found on the blockchain. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet been broadcast to the network | +| 422 | One or more input transactions for your transaction were not found in the mempool. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet been broadcast to the network | | 422 | One or more input transactions for your transactions are not yet confirmed in at least one block. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet confirmed in at least one block on the network | | 500 | Error broadcasting payment to network | Our Bitcoin node returned an error when attempting to broadcast your transaction to the network. This could mean our node is experiencing an outage or your transaction is a double spend. | From 1123439fe699d769677225a1e93eae423e5f5de6 Mon Sep 17 00:00:00 2001 From: Jonas Lundqvist Date: Wed, 3 Oct 2018 22:43:18 +0200 Subject: [PATCH 2/3] Add requiredInputConfirmations parameter Add flexibility to the protocol by the possibility to allow 0-conf transactions as inputs to the payment. This parameter can also be used for setting a higher confirmation count on the input then the default 1. --- specification.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification.md b/specification.md index d22b84a..1961e1e 100644 --- a/specification.md +++ b/specification.md @@ -40,6 +40,7 @@ On a successful request, the response will contain the following headers. * `network` - Which network is this request for (main / test / regtest) * `currency` - Three digit currency code representing which coin the request is based on * `requiredFeeRate` - The minimum fee per byte required on this transaction. Payment will be rejected if fee rate included for the transaction is not at least this value. _May be fractional value_ ie 0.123 sat/byte +* `requiredInputConfirmations` - The minimum number of confirmations on the blockchain for each transaction input. Can be 0 which means that the input is unconfirmed but needs to be broadcasted and found in the servers mempool. * `outputs` - What output(s) your transaction must include in order to be accepted * `time` - ISO Date format of when the invoice was generated * `expires` - ISO Date format of when the invoice will expire @@ -317,7 +318,7 @@ This invoice is no longer accepting payments | 400 | Transaction fee (X sat/kb) is below the current minimum threshold (Y sat/kb) | Your fee must be at least the amount sent in the payment request as `requiredFeePerByte`| | 400 | This invoice is priced in BTC, not BCH. Please try with a BTC wallet instead | Your transaction currency did not match the one on the invoice | | 422 | One or more input transactions for your transaction were not found in the mempool. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet been broadcast to the network | -| 422 | One or more input transactions for your transactions are not yet confirmed in at least one block. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet confirmed in at least one block on the network | +| 422 | One or more input transactions for your transactions are not yet confirmed in at least the required number of blocks. Make sure you're not trying to use unconfirmed change | Spending outputs which have not yet confirmed in at least `requiredInputConfirmations` blocks on the blockchain | | 500 | Error broadcasting payment to network | Our Bitcoin node returned an error when attempting to broadcast your transaction to the network. This could mean our node is experiencing an outage or your transaction is a double spend. | Another issue you may see is that you are being redirected to `bitpay.com/invoice?id=xxx` instead of being sent a payment-request. In that case you are not setting your `Accept` header to a valid value and we assume you are a browser or other unknown requester. From 47b18ac1d1c76811b54af9056c84585e2f1fb793 Mon Sep 17 00:00:00 2001 From: Jonas Lundqvist Date: Wed, 3 Oct 2018 22:47:57 +0200 Subject: [PATCH 3/3] Bump revision number to 0.7 --- specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification.md b/specification.md index 1961e1e..f4fb885 100644 --- a/specification.md +++ b/specification.md @@ -1,6 +1,6 @@ # JSON Payment Protocol Specification -Revision 0.6 +Revision 0.7 ## Application Logic