Discussion:
[Bitcoin-development] BIP for Proof of Payment
(too old to reply)
Kalle Rosenbaum
2015-06-06 14:35:17 UTC
Permalink
Hi

Following earlier posts on Proof of Payment I'm now proposing the following
BIP (To read it formatted instead, go to
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP).

Regards,
Kalle Rosenbaum

<pre>
BIP: <BIP number>
Title: Proof of Payment
Author: Kalle Rosenbaum <***@rosenbaum.se>
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>

== Abstract ==

This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.

== Motivation ==

There are several scenarios in which it would be useful to prove that you
have paid for something. For example:

* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.

With Proof of Payment, these use cases can be achieved without any personal
information (user name, password, e-mail address, etc) being involved.

== Rationale ==

Desirable properties:

# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the inputs
of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.

Current methods of proving a payment:

* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.

If the script type is P2SH, any satisfying script should do, just like for
a payment. For M-of-N multisig scripts, that would mean that any set of M
keys should be sufficient, not neccesarily the same set of M keys that
signed the transaction. This is important because strictly demanding the
same set of M keys would undermine the purpose of a multisig address.

== Specification ==

=== Data structure ===

A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs and outputs as T and in the same order as in T. There is
also one OP_RETURN output inserted at index 0, here called the pop output.
This output must have the following format:

OP_RETURN <version> <txid> <nonce>

{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}

The value of the pop output is set to the same value as the transaction fee
of T. Also, if the outputs of T contains an OP_RETURN output, that output
must not be included in the PoP because there can only be one OP_RETURN
output in a transaction. The value of that OP_RETURN output is instead
added to the value of the pop output.

An illustration of the PoP data structure and its original payment is shown
below.

<pre>
T
+----------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------+
|input0 1 | 0 pay to A |
|input1 3 | 2 OP_RETURN <some data> |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------+

PoP(T)
+----------------------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------------------+
|input0 1 | 3 OP_RETURN <version> <txid> <nonce> |
|input1 3 | 0 pay to A |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------------------+
</pre>

The PoP is signed using the same signing process that is used for bitcoin
transactions.

The purpose of the nonce is to make it harder to use a stolen PoP; Once the
PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.

Since a PoP is indistinguishable from a bitcoin transaction, there is a
risk that it, accidently or maliciously, enters the bitcoin p2p network. If
T is still unconfirmed, or if a reorg takes place, chances are that PoP(T)
ends up in a block, invalidating T. Therefore it is important that the
outputs of the PoP are the same as in T. The zero transaction fee in PoP(T)
is to minimize the incentives for miners to select PoP(T) for inclusion.

=== Process ===

# A proof of payment request is sent from the server to the wallet. The PoP
request contains:
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
example:
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URL
# The wallet identifies a transaction T, if possible. Otherwise it asks the
user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.

'''Remarks:'''

* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.

=== Validating a PoP ===

The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is
aborted and "invalid" is returned:

# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check the PoP output at index 0. It must conform to the OP_RETURN output
format outlined above.
# Check that the rest of the outputs exactly corresponds to the outputs of
T and that they appear in the same order as in T. An exception to this is
that any OP_RETURN outputs of T must not be included in the PoP. All output
value from the OP_RETURN must instead be included in the PoP output.
# Check that the nonce is the same as the one you requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, and in the same order.
# Check the scripts of all the inputs, as would be done on a normal
transaction.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".

== Security considerations ==

* Someone can intercept the PoP-request and change the PoP destination so
that the user sends the PoP to the bad actor.
* Someone can intercept the PoP-request and change for example the txid to
trick the user to sign a PoP for another transaction than the intended.
This can of course be avoided if the user is actually looking at the UPoP
before signing it. The bad actor could also set hints for a transaction,
existing or not, that the user didn’t make, resulting in a broken service.
* Someone can steal a PoP and try to use the service hoping to get a
matching nonce. Probability per try: 1/(2^48). The server should have a
mechanism for detecting a brute force attack of this kind, or at least slow
down the process by delaying the PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another transaction
id than the wallet for the payment. In that case the wallet will not be
able to prove the transaction for the server. Wallets should not rely on
the transaction id of the outgoing transaction. Instead it should listen
for the transaction on the network and put that in its list of transactions.

The first two issues are the same attack vector as for traditional, ie
BIP0021, bitcoin payments. They could be mitigated by using secure
connections.

== Reference implementation ==

[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]

[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]

== References ==

[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki BIP0021]:
URI Scheme

[https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki BIP0070]:
Payment Protocol

[[btcpop scheme BIP]]
Pieter Wuille
2015-06-06 14:47:05 UTC
Permalink
What do you gain by making PoPs actually valid transactions? You could for
example change the signature hashing algorithm (prepend a constant string,
or add a second hashing step) for signing, rendering the signatures in a
PoP unusable for actual transaction, while still committing to the same
actual transaction. That would also remove the need for the OP_RETURN to
catch fees.

Also, I would call it "proof of transaction intent", as it's a commitment
to a transaction and proof of its validity, but not a proof that an actual
transaction took place, nor a means to prevent it from being double spent.
Post by Kalle Rosenbaum
Hi
Following earlier posts on Proof of Payment I'm now proposing the
following BIP (To read it formatted instead, go to
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP).
Regards,
Kalle Rosenbaum
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that you
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.
* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
If the script type is P2SH, any satisfying script should do, just like for
a payment. For M-of-N multisig scripts, that would mean that any set of M
keys should be sufficient, not neccesarily the same set of M keys that
signed the transaction. This is important because strictly demanding the
same set of M keys would undermine the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs and outputs as T and in the same order as in T. There is
also one OP_RETURN output inserted at index 0, here called the pop output.
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The value of the pop output is set to the same value as the transaction
fee of T. Also, if the outputs of T contains an OP_RETURN output, that
output must not be included in the PoP because there can only be one
OP_RETURN output in a transaction. The value of that OP_RETURN output is
instead added to the value of the pop output.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+----------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------+
|input0 1 | 0 pay to A |
|input1 3 | 2 OP_RETURN <some data> |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------+
PoP(T)
+----------------------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------------------+
|input0 1 | 3 OP_RETURN <version> <txid> <nonce> |
|input1 3 | 0 pay to A |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for bitcoin
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.
Since a PoP is indistinguishable from a bitcoin transaction, there is a
risk that it, accidently or maliciously, enters the bitcoin p2p network. If
T is still unconfirmed, or if a reorg takes place, chances are that PoP(T)
ends up in a block, invalidating T. Therefore it is important that the
outputs of the PoP are the same as in T. The zero transaction fee in PoP(T)
is to minimize the incentives for miners to select PoP(T) for inclusion.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URL
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check the PoP output at index 0. It must conform to the OP_RETURN output
format outlined above.
# Check that the rest of the outputs exactly corresponds to the outputs of
T and that they appear in the same order as in T. An exception to this is
that any OP_RETURN outputs of T must not be included in the PoP. All output
value from the OP_RETURN must instead be included in the PoP output.
# Check that the nonce is the same as the one you requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, and in the same order.
# Check the scripts of all the inputs, as would be done on a normal
transaction.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change the PoP destination so
that the user sends the PoP to the bad actor.
* Someone can intercept the PoP-request and change for example the txid to
trick the user to sign a PoP for another transaction than the intended.
This can of course be avoided if the user is actually looking at the UPoP
before signing it. The bad actor could also set hints for a transaction,
existing or not, that the user didn’t make, resulting in a broken service.
* Someone can steal a PoP and try to use the service hoping to get a
matching nonce. Probability per try: 1/(2^48). The server should have a
mechanism for detecting a brute force attack of this kind, or at least slow
down the process by delaying the PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id than the wallet for the payment. In that case the wallet
will not be able to prove the transaction for the server. Wallets should
not rely on the transaction id of the outgoing transaction. Instead it
should listen for the transaction on the network and put that in its list
of transactions.
The first two issues are the same attack vector as for traditional, ie
BIP0021, bitcoin payments. They could be mitigated by using secure
connections.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
URI Scheme
Payment Protocol
[[btcpop scheme BIP]]
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Kalle Rosenbaum
2015-06-06 15:05:36 UTC
Permalink
Post by Pieter Wuille
What do you gain by making PoPs actually valid transactions? You could for
example change the signature hashing algorithm (prepend a constant string,
or add a second hashing step) for signing, rendering the signatures in a PoP
unusable for actual transaction, while still committing to the same actual
transaction. That would also remove the need for the OP_RETURN to catch
fees.
The idea is to simplify implementation. Existing software can be used
as is to sign and validate PoPs. But I do agree that it would be a
cleaner specification if we would make the PoP invalid as a
transaction. I'm open to changes here. I do like the idea to prepend a
constant string. But that would require changes in transaction signing
and validation code, wouldn't it?
Post by Pieter Wuille
Also, I would call it "proof of transaction intent", as it's a commitment to
a transaction and proof of its validity, but not a proof that an actual
transaction took place, nor a means to prevent it from being double spent.
Naming is hard. I think a simpler name that explains what its main
purpose is (prove that you paid for something) is better than a name
that exactly tries to explain what it is. "Proof of transaction
intent" does not help me understand what this is about. But I would
like to see more name suggestions. The name does not prevent people
from using it for other purposes, ie internet over telephone network.

Thank you
/Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Hi
Following earlier posts on Proof of Payment I'm now proposing the
following BIP (To read it formatted instead, go to
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP).
Regards,
Kalle Rosenbaum
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that you
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.
* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
If the script type is P2SH, any satisfying script should do, just like for
a payment. For M-of-N multisig scripts, that would mean that any set of M
keys should be sufficient, not neccesarily the same set of M keys that
signed the transaction. This is important because strictly demanding the
same set of M keys would undermine the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs and outputs as T and in the same order as in T. There is
also one OP_RETURN output inserted at index 0, here called the pop output.
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The value of the pop output is set to the same value as the transaction
fee of T. Also, if the outputs of T contains an OP_RETURN output, that
output must not be included in the PoP because there can only be one
OP_RETURN output in a transaction. The value of that OP_RETURN output is
instead added to the value of the pop output.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+----------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------+
|input0 1 | 0 pay to A |
|input1 3 | 2 OP_RETURN <some data> |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------+
PoP(T)
+----------------------------------------------------------+
|inputs | outputs |
| Value | Value Script |
+----------------------------------------------------------+
|input0 1 | 3 OP_RETURN <version> <txid> <nonce> |
|input1 3 | 0 pay to A |
|input2 4 | 1 pay to B |
| | 4 pay to C |
+----------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for bitcoin
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.
Since a PoP is indistinguishable from a bitcoin transaction, there is a
risk that it, accidently or maliciously, enters the bitcoin p2p network. If
T is still unconfirmed, or if a reorg takes place, chances are that PoP(T)
ends up in a block, invalidating T. Therefore it is important that the
outputs of the PoP are the same as in T. The zero transaction fee in PoP(T)
is to minimize the incentives for miners to select PoP(T) for inclusion.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URL
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is aborted
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check the PoP output at index 0. It must conform to the OP_RETURN output
format outlined above.
# Check that the rest of the outputs exactly corresponds to the outputs of
T and that they appear in the same order as in T. An exception to this is
that any OP_RETURN outputs of T must not be included in the PoP. All output
value from the OP_RETURN must instead be included in the PoP output.
# Check that the nonce is the same as the one you requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, and in the same order.
# Check the scripts of all the inputs, as would be done on a normal
transaction.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change the PoP destination so
that the user sends the PoP to the bad actor.
* Someone can intercept the PoP-request and change for example the txid to
trick the user to sign a PoP for another transaction than the intended. This
can of course be avoided if the user is actually looking at the UPoP before
signing it. The bad actor could also set hints for a transaction, existing
or not, that the user didn’t make, resulting in a broken service.
* Someone can steal a PoP and try to use the service hoping to get a
matching nonce. Probability per try: 1/(2^48). The server should have a
mechanism for detecting a brute force attack of this kind, or at least slow
down the process by delaying the PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id than the wallet for the payment. In that case the wallet will
not be able to prove the transaction for the server. Wallets should not rely
on the transaction id of the outgoing transaction. Instead it should listen
for the transaction on the network and put that in its list of transactions.
The first two issues are the same attack vector as for traditional, ie
BIP0021, bitcoin payments. They could be mitigated by using secure
connections.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
URI Scheme
Payment Protocol
[[btcpop scheme BIP]]
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
Pieter Wuille
2015-06-06 15:13:46 UTC
Permalink
Post by Pieter Wuille
Post by Pieter Wuille
What do you gain by making PoPs actually valid transactions? You could
for
Post by Pieter Wuille
example change the signature hashing algorithm (prepend a constant
string,
Post by Pieter Wuille
or add a second hashing step) for signing, rendering the signatures in a
PoP
Post by Pieter Wuille
unusable for actual transaction, while still committing to the same
actual
Post by Pieter Wuille
transaction. That would also remove the need for the OP_RETURN to catch
fees.
The idea is to simplify implementation. Existing software can be used
as is to sign and validate PoPs. But I do agree that it would be a
cleaner specification if we would make the PoP invalid as a
transaction. I'm open to changes here. I do like the idea to prepend a
constant string. But that would require changes in transaction signing
and validation code, wouldn't it?
Yes, of course. An alternative is adding a 21M BTC output at the end, or
bitflipping the txin prevout hashes, or another reversible transformation
on the transaction data that is guaranteed to invalidate it.

I think that the risk of asking people to sign something that is not an
actual transaction, but could be used as one, is very scary.
Post by Pieter Wuille
Post by Pieter Wuille
Also, I would call it "proof of transaction intent", as it's a
commitment to
Post by Pieter Wuille
a transaction and proof of its validity, but not a proof that an actual
transaction took place, nor a means to prevent it from being double
spent.
Naming is hard. I think a simpler name that explains what its main
purpose is (prove that you paid for something) is better than a name
that exactly tries to explain what it is.
"Proof of Payment" indeed does make me think it's something that proves you
paid. But as described, that is not what a PoP does. It proves the ability
to create a particular transaction, and committing to it. There is no
actual payment involved (plus, payment makes me think you're talking about
BIP70 payments, not simple Bitcoin transactions).
Post by Pieter Wuille
"Proof of transaction
intent" does not help me understand what this is about. But I would
like to see more name suggestions. The name does not prevent people
from using it for other purposes, ie internet over telephone network.
I don't understand why something like "Proof of Transaction Intent" would
be incompatible with internet over telephone network either...
--
Pieter
Kalle Rosenbaum
2015-06-06 16:20:41 UTC
Permalink
Post by Pieter Wuille
Post by Kalle Rosenbaum
The idea is to simplify implementation. Existing software can be used
as is to sign and validate PoPs. But I do agree that it would be a
cleaner specification if we would make the PoP invalid as a
transaction. I'm open to changes here. I do like the idea to prepend a
constant string. But that would require changes in transaction signing
and validation code, wouldn't it?
Yes, of course. An alternative is adding a 21M BTC output at the end, or
bitflipping the txin prevout hashes, or another reversible transformation on
the transaction data that is guaranteed to invalidate it.
If we do decide to make Pops invalid as transactions, there are a lot
of ways to do that. I guess the main question is if we should make
Pops invalid as transactions or not. So far I prefer to keep them
valid for the above reason.
Post by Pieter Wuille
I think that the risk of asking people to sign something that is not an
actual transaction, but could be used as one, is very scary.
I would feel comfortable doing it. It's just a matter of trusting your
wallet, which you already do with your ordinary transactions.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Also, I would call it "proof of transaction intent", as it's a commitment to
a transaction and proof of its validity, but not a proof that an actual
transaction took place, nor a means to prevent it from being double spent.
Naming is hard. I think a simpler name that explains what its main
purpose is (prove that you paid for something) is better than a name
that exactly tries to explain what it is.
"Proof of Payment" indeed does make me think it's something that proves you
paid. But as described, that is not what a PoP does. It proves the ability
to create a particular transaction, and committing to it. There is no actual
payment involved (plus, payment makes me think you're talking about BIP70
payments, not simple Bitcoin transactions).
Post by Kalle Rosenbaum
"Proof of transaction
intent" does not help me understand what this is about. But I would
like to see more name suggestions. The name does not prevent people
from using it for other purposes, ie internet over telephone network.
I don't understand why something like "Proof of Transaction Intent" would be
incompatible with internet over telephone network either...
No, I meant that it's ok to call it Proof of Payment even though
people may use it for other stuff.
Post by Pieter Wuille
--
Pieter
------------------------------------------------------------------------------
Tom Harding
2015-06-06 16:10:55 UTC
Permalink
Post by Kalle Rosenbaum
I'm open to changes here.
I suggest:

- Don't include any real outputs. They are redundant because the txid is
already referenced.

- Start the proof script, which should be invalid, with a magic constant
and include space for future expansion. This makes PoP's easy to identify
and extend.

- "Proof of Potential"
Kalle Rosenbaum
2015-06-06 17:00:39 UTC
Permalink
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic constant and
include space for future expansion. This makes PoP's easy to identify and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)

Thank you
/Kalle

------------------------------------------------------------------------------
Kalle Rosenbaum
2015-06-06 21:25:02 UTC
Permalink
Thank you all for the feedback.

I will change the data structure as follows:

* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.

Any comments on this?

/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic constant and
include space for future expansion. This makes PoP's easy to identify and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
Luke Dashjr
2015-06-06 22:01:08 UTC
Permalink
Post by Kalle Rosenbaum
* The pop output will have value 0.
Why not have it be -1 to make it completely invalid as a transaction?

Luke

------------------------------------------------------------------------------
Kalle Rosenbaum
2015-06-15 09:21:06 UTC
Permalink
Hi all!

I have made the discussed changes and updated my implementation (
https://github.com/kallerosenbaum/poppoc) accordingly. These are the
changes:

* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block height lock
time).

The comments so far has been mainly positive or neutral. Are there any
major objections against any of the two proposals? If not, I will ask
Gregory Maxwell to assign them BIP numbers.

The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The source
for the Proof of Payment BIP proposal is also in-lined below.

A number of alternative names have been proposed:

* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID

Given this list, I still think "Proof of Payment" is the most descriptive
to non-technical people.

Regards,
Kalle


#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Author: Kalle Rosenbaum <***@rosenbaum.se>
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>

== Abstract ==

This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.

== Motivation ==

There are several scenarios in which it would be useful to prove that you
have paid for something. For example:

* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.

With Proof of Payment, these use cases can be achieved without any personal
information (user name, password, e-mail address, etc) being involved.

== Rationale ==

Desirable properties:

# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the inputs
of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.

Current methods of proving a payment:

* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.

If an input script type is P2SH, any satisfying script should do, just as
if it was a payment. For M-of-N multisig scripts, that would mean that any
set of M keys should be sufficient, not neccesarily the same set of M keys
that signed the transaction. This is important because strictly demanding
the same set of M keys would defeat the purpose of a multisig address.

== Specification ==

=== Data structure ===

A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs as T and in the same order as in T, but with each sequence
number set to 0. There is exactly one output, here called the pop output,
with value 0. The pop output must have the following format:

OP_RETURN <version> <txid> <nonce>

{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}

The lock_time of the PoP must be set to 499999999 to prevent the PoP from
being included in a block, should it appear on the bitcoin p2p network.
This is also the reason for setting the sequence numbers to 0, since
sequence number of ffffffff would make lock_time ineffective. This
specification demands that all input sequence numbers are 0, not just one
of them, which would be sufficient to make lock_time effective. This is for
simplicity reasons.

An illustration of the PoP data structure and its original payment is shown
below.

<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+

PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>

The PoP is signed using the same signing process that is used for bitcoin
transactions.

The purpose of the nonce is to make it harder to use a stolen PoP; Once the
PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.

=== Process ===

# A proof of payment request is sent from the server to the wallet. The PoP
request contains:
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
example:
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise it asks the
user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.

'''Remarks:'''

* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.

=== Validating a PoP ===

The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is
aborted and "invalid" is returned:

# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have value 0 and
conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, except that the sequence numbers must all be 0. The ordering of the
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".

== Security considerations ==

* Someone can intercept the PoP-request and change any parameter in it.
These can be mitigated by using secure connections. For example:
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label that your
wallet doesn't have any record for, resulting in a broken service. Always
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the PoP request,
and try to use the service hoping to get a matching nonce. Probability per
try: 1/(2^48). The server should have a mechanism for detecting a brute
force attack of this kind, or at least slow down the process by delaying
the PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another transaction
id for a payment than the client's wallet. In that case the wallet will not
be able to prove the transaction to the server. Wallets should not rely on
the transaction id of the outgoing transaction. Instead it should listen
for the transaction on the network and put that in its list of transactions.

== Reference implementation ==

[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]

[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]

== References ==

[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki BIP0021]:
URI Scheme

[https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki BIP0070]:
Payment Protocol

[[btcpop scheme BIP]]

#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic constant and
include space for future expansion. This makes PoP's easy to identify and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
Pieter Wuille
2015-06-15 10:00:52 UTC
Permalink
I did misunderstand that. That changes things significantly.

However, having paid is not the same as having had access to the input
coins. What about shared wallets or coinjoin?

Also, if I understand correctly, there is no commitment to anything you're
trying to say about the sender? So once I obtain a proof-of-payment from
you about something you paid, I can go claim that it's mine?

Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then
have the shop insist that I can't drink it because I'm not the buyer.

Track payments, don't try to assign identities to payers.
Hi Pieter!
It is intended to be a proof that you *have paid* for something. Not
that you have the intent to pay for something. You cannot use PoP
without a transaction to prove.
So, yes, it's just a proof of access to certain coins that you no longer
have.
Maybe I don't understand you correctly?
/Kalle
Now that you have removed the outputs, I don't think it's even a intent
of
payment, but just a proof of access to certain coins.
Post by Kalle Rosenbaum
Hi all!
I have made the discussed changes and updated my implementation
(https://github.com/kallerosenbaum/poppoc) accordingly. These are the
* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block height
lock
Post by Kalle Rosenbaum
time).
The comments so far has been mainly positive or neutral. Are there any
major objections against any of the two proposals? If not, I will ask
Gregory Maxwell to assign them BIP numbers.
The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The
source
Post by Kalle Rosenbaum
for the Proof of Payment BIP proposal is also in-lined below.
* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID
Given this list, I still think "Proof of Payment" is the most
descriptive
Post by Kalle Rosenbaum
to non-technical people.
Regards,
Kalle
#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that
you
Post by Kalle Rosenbaum
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it
on
Post by Kalle Rosenbaum
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity.
During
Post by Kalle Rosenbaum
this period you can upload new content to the sign whenever you like
using
Post by Kalle Rosenbaum
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself
using
Post by Kalle Rosenbaum
PoP.
* A lottery where all participants pay to the same address, and the
winner
Post by Kalle Rosenbaum
is selected among the transactions to that address. You exchange the
prize
Post by Kalle Rosenbaum
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of
script
Post by Kalle Rosenbaum
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease
adoption.
Post by Kalle Rosenbaum
* In BIP0070, the PaymentRequest together with the transactions
fulfilling
Post by Kalle Rosenbaum
the request makes some sort of proof. However, it does not meet 1, 2 or
4
Post by Kalle Rosenbaum
and it obviously only meets 3 if the payment is made through BIP0070.
Also,
Post by Kalle Rosenbaum
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This
is
Post by Kalle Rosenbaum
not standardized either. 4 Could be met if designed so.
If an input script type is P2SH, any satisfying script should do, just
as
Post by Kalle Rosenbaum
if it was a payment. For M-of-N multisig scripts, that would mean that
any
Post by Kalle Rosenbaum
set of M keys should be sufficient, not neccesarily the same set of M
keys
Post by Kalle Rosenbaum
that signed the transaction. This is important because strictly
demanding
Post by Kalle Rosenbaum
the same set of M keys would defeat the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction
with
Post by Kalle Rosenbaum
the same inputs as T and in the same order as in T, but with each
sequence
Post by Kalle Rosenbaum
number set to 0. There is exactly one output, here called the pop
output,
Post by Kalle Rosenbaum
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01
0x00
Post by Kalle Rosenbaum
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The lock_time of the PoP must be set to 499999999 to prevent the PoP
from
Post by Kalle Rosenbaum
being included in a block, should it appear on the bitcoin p2p network.
This
Post by Kalle Rosenbaum
is also the reason for setting the sequence numbers to 0, since sequence
number of ffffffff would make lock_time ineffective. This specification
demands that all input sequence numbers are 0, not just one of them,
which
Post by Kalle Rosenbaum
would be sufficient to make lock_time effective. This is for simplicity
reasons.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+
PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for
bitcoin
Post by Kalle Rosenbaum
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server
will
Post by Kalle Rosenbaum
generate a new nonce for every PoP request.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or
"invalid".
Post by Kalle Rosenbaum
That process is outlined below. If any step fails, the validation is
aborted
Post by Kalle Rosenbaum
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have value 0
and conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in
transaction
Post by Kalle Rosenbaum
T, except that the sequence numbers must all be 0. The ordering of the
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want
proof
Post by Kalle Rosenbaum
for, check that the transaction actually pays for the product/service
you
Post by Kalle Rosenbaum
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change any parameter in it.
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label that your
wallet doesn't have any record for, resulting in a broken service.
Always
Post by Kalle Rosenbaum
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the PoP
request,
Post by Kalle Rosenbaum
and try to use the service hoping to get a matching nonce. Probability
per
Post by Kalle Rosenbaum
try: 1/(2^48). The server should have a mechanism for detecting a brute
force attack of this kind, or at least slow down the process by
delaying the
Post by Kalle Rosenbaum
PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a
generator
Post by Kalle Rosenbaum
for PoPs. This makes it important to keep the security of the wallet
after
Post by Kalle Rosenbaum
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id for a payment than the client's wallet. In that case the
wallet will not be able to prove the transaction to the server. Wallets
should not rely on the transaction id of the outgoing transaction.
Instead
Post by Kalle Rosenbaum
it should listen for the transaction on the network and put that in its
list
Post by Kalle Rosenbaum
of transactions.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
URI Scheme
[https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki
Payment Protocol
[[btcpop scheme BIP]]
#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic constant and
include space for future expansion. This makes PoP's easy to
identify
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Tom Harding
and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
Post by Kalle Rosenbaum
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Kalle Rosenbaum
2015-06-15 11:59:45 UTC
Permalink
Post by Pieter Wuille
I did misunderstand that. That changes things significantly.
However, having paid is not the same as having had access to the input
coins. What about shared wallets or coinjoin?
Wallets will have the same ability to make PoPs as they have in making
payments, see my motivation and rationale sections. CoinJoin is not
compatible with PoP, Luke-Jr brought that up a week ago:

"This appears to be incompatible with CoinJoin at least. Maybe there's some
clean way to avoid that by using
https://github.com/Blockstream/contracthashtool ?"

I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Post by Pieter Wuille
Also, if I understand correctly, there is no commitment to anything you're
trying to say about the sender? So once I obtain a proof-of-payment from you
about something you paid, I can go claim that it's mine?
I don't understand this. The pop includes a nonce randomly generated
by the server. If you're very lucky, 1/(2^48) per try, you can reuse a
pop.
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.

Regards,
Kalle
Post by Pieter Wuille
Hi Pieter!
It is intended to be a proof that you *have paid* for something. Not
that you have the intent to pay for something. You cannot use PoP
without a transaction to prove.
So, yes, it's just a proof of access to certain coins that you no longer
have.
Maybe I don't understand you correctly?
/Kalle
Now that you have removed the outputs, I don't think it's even a intent
of
payment, but just a proof of access to certain coins.
Post by Kalle Rosenbaum
Hi all!
I have made the discussed changes and updated my implementation
(https://github.com/kallerosenbaum/poppoc) accordingly. These are the
* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block height lock
time).
The comments so far has been mainly positive or neutral. Are there any
major objections against any of the two proposals? If not, I will ask
Gregory Maxwell to assign them BIP numbers.
The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The source
for the Proof of Payment BIP proposal is also in-lined below.
* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID
Given this list, I still think "Proof of Payment" is the most descriptive
to non-technical people.
Regards,
Kalle
#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that you
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.
* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
If an input script type is P2SH, any satisfying script should do, just as
if it was a payment. For M-of-N multisig scripts, that would mean that any
set of M keys should be sufficient, not neccesarily the same set of M keys
that signed the transaction. This is important because strictly demanding
the same set of M keys would defeat the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs as T and in the same order as in T, but with each sequence
number set to 0. There is exactly one output, here called the pop output,
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The lock_time of the PoP must be set to 499999999 to prevent the PoP from
being included in a block, should it appear on the bitcoin p2p network.
This
is also the reason for setting the sequence numbers to 0, since sequence
number of ffffffff would make lock_time ineffective. This specification
demands that all input sequence numbers are 0, not just one of them,
which
would be sufficient to make lock_time effective. This is for simplicity
reasons.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+
PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for bitcoin
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is aborted
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have value 0
and conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, except that the sequence numbers must all be 0. The ordering of the
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change any parameter in it.
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label that your
wallet doesn't have any record for, resulting in a broken service. Always
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the PoP request,
and try to use the service hoping to get a matching nonce. Probability per
try: 1/(2^48). The server should have a mechanism for detecting a brute
force attack of this kind, or at least slow down the process by
delaying the
PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id for a payment than the client's wallet. In that case the
wallet will not be able to prove the transaction to the server. Wallets
should not rely on the transaction id of the outgoing transaction.
Instead
it should listen for the transaction on the network and put that in its
list
of transactions.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
URI Scheme
Payment Protocol
[[btcpop scheme BIP]]
#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic
constant and
include space for future expansion. This makes PoP's easy to
identify
and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
Pieter Wuille
2015-06-16 14:31:34 UTC
Permalink
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction corresponds to a
single payment. This is true for simple wallet use cases, but not
compatible with CoinJoin, or with systems that for example would want to
combine multiple payments in a single transaction.
Post by Kalle Rosenbaum
Post by Pieter Wuille
Also, if I understand correctly, there is no commitment to anything
you're
Post by Pieter Wuille
trying to say about the sender? So once I obtain a proof-of-payment from
you
Post by Pieter Wuille
about something you paid, I can go claim that it's mine?
I don't understand this. The pop includes a nonce randomly generated
by the server. If you're very lucky, 1/(2^48) per try, you can reuse a
pop.
I owe you an apology here, for judging based on the summary you posted
rather than reading the actual text.

48 bits seems low to me, but it does indeed solve the problem. Why not 128
or 256 bits?
Post by Kalle Rosenbaum
Why does anyone care who paid? This is like walking into a coffeshop,
Post by Pieter Wuille
noticing I don't have money with me, let me friend pay for me, and then
have
Post by Pieter Wuille
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet who held
the coins is the payer/buyer. That's what I said earlier; you're implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not necessary. The
receiver should not care who paid or how, he should care what was payed for.

The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying, and
that knowledge of that token is used to gain access to the services you
provide.
--
Pieter
Kalle Rosenbaum
2015-06-16 19:22:54 UTC
Permalink
Thank you for your comments Pieter! Please find my answers below.
Post by Pieter Wuille
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction corresponds to a
single payment. This is true for simple wallet use cases, but not compatible
with CoinJoin, or with systems that for example would want to combine
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the likes.
Post by Pieter Wuille
48 bits seems low to me, but it does indeed solve the problem. Why not 128
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited to
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet who held
the coins is the payer/buyer. That's what I said earlier; you're implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not necessary. The
receiver should not care who paid or how, he should care what was payed for.
You are saying that it's a problem that the wallet used to pay, must
also be used to issue the PoP? That may very well be a problem in some
cases. People using PoP should of course be aware of it's limitations
and act accordingly, i.e. don't pay for concert tickets for a friend
and expect your friend to be able to enter the arena with her wallet.
As Tom Harding noted, it is possible to transfer keys to your friend's
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal all
keys in that tree. Another solution is that your friend forwards the
PoP request to your wallet, through twitter or SMS, and you send the
PoP for her. Maybe that forwarding mechanism can be built into wallets
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.

Of course the simplest solution would be to send money to your friend
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
Post by Pieter Wuille
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying, and
that knowledge of that token is used to gain access to the services you
provide.
That token would then be reusable. Someone stealing it would be able
to use it as much as she wants. That is what I want to avoid with PoP.
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on this
list on Mars 13 that I think covers most pros and cons of the
different approaches.

While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the wallet
that pays. Otherwise you would need to keep it in another safe place,
remember it's reusable. Where would that be? How would you transfer
that token to your friend?

Thank you again for your comments. I appreciate it.

Best regards,
Kalle
Post by Pieter Wuille
--
Pieter
------------------------------------------------------------------------------
Pieter Wuille
2015-06-16 19:25:12 UTC
Permalink
You can't avoid sharing the token, and you can't avoid sharing the private
keys used for signing either. If they are single use, you don't lose
anything by sharing them.

Also you are not creating a real transaction. Why does the OP_RETURN
limitation matter?
Post by Kalle Rosenbaum
Thank you for your comments Pieter! Please find my answers below.
Post by Pieter Wuille
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction corresponds to a
single payment. This is true for simple wallet use cases, but not
compatible
Post by Pieter Wuille
with CoinJoin, or with systems that for example would want to combine
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the likes.
Post by Pieter Wuille
48 bits seems low to me, but it does indeed solve the problem. Why not
128
Post by Pieter Wuille
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited to
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and
then
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet who held
the coins is the payer/buyer. That's what I said earlier; you're
implicitly
Post by Pieter Wuille
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not necessary. The
receiver should not care who paid or how, he should care what was payed
for.
You are saying that it's a problem that the wallet used to pay, must
also be used to issue the PoP? That may very well be a problem in some
cases. People using PoP should of course be aware of it's limitations
and act accordingly, i.e. don't pay for concert tickets for a friend
and expect your friend to be able to enter the arena with her wallet.
As Tom Harding noted, it is possible to transfer keys to your friend's
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal all
keys in that tree. Another solution is that your friend forwards the
PoP request to your wallet, through twitter or SMS, and you send the
PoP for her. Maybe that forwarding mechanism can be built into wallets
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.
Of course the simplest solution would be to send money to your friend
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
Post by Pieter Wuille
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying,
and
Post by Pieter Wuille
that knowledge of that token is used to gain access to the services you
provide.
That token would then be reusable. Someone stealing it would be able
to use it as much as she wants. That is what I want to avoid with PoP.
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on this
list on Mars 13 that I think covers most pros and cons of the
different approaches.
While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the wallet
that pays. Otherwise you would need to keep it in another safe place,
remember it's reusable. Where would that be? How would you transfer
that token to your friend?
Thank you again for your comments. I appreciate it.
Best regards,
Kalle
Post by Pieter Wuille
--
Pieter
Pieter Wuille
2015-06-16 19:48:54 UTC
Permalink
I don't see why existing software could create a 40-byte OP_RETURN but not
larger? The limitation comes from a relay policy in full nodes, not a
limitation is wallet software... and PoPs are not relayed on the network.

Regarding sharing, I think you're talking about a different use case. Say
you want to pay for 1-week valid entrance to some venue. I thought the
purpose of the PoP was to be sure that only the person who paid for it, and
not anyone else can use it during that week.

My argument against that is that the original payer can also hand the
private keys in his wallet to someone else, who would then become able to
create PoPs for the service. He does not lose anything by this, assuming
the address is not reused.

So, using a token does not change anything, except it can be provided to
the payer - instead of relying on creating an implicit identity based on
who seems to have held particular private keys in the past.
Post by Kalle Rosenbaum
Post by Pieter Wuille
You can't avoid sharing the token, and you can't avoid sharing the
private
Post by Pieter Wuille
keys used for signing either. If they are single use, you don't lose
anything by sharing them.
Forwarding the PoP request would be a way to avoid sharing keys, as
suggested above.
Post by Pieter Wuille
Also you are not creating a real transaction. Why does the OP_RETURN
limitation matter?
This was discussed in the beginning of this thread: "The idea is to
simplify implementation. Existing software can be used as is to sign
and validate PoPs"
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Thank you for your comments Pieter! Please find my answers below.
Post by Pieter Wuille
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction corresponds
to
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
a
single payment. This is true for simple wallet use cases, but not compatible
with CoinJoin, or with systems that for example would want to combine
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the likes.
Post by Pieter Wuille
48 bits seems low to me, but it does indeed solve the problem. Why not 128
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited to
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a
coffeshop,
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
noticing I don't have money with me, let me friend pay for me, and then
have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront),
there's
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet who held
the coins is the payer/buyer. That's what I said earlier; you're implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not necessary. The
receiver should not care who paid or how, he should care what was
payed
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
for.
You are saying that it's a problem that the wallet used to pay, must
also be used to issue the PoP? That may very well be a problem in some
cases. People using PoP should of course be aware of it's limitations
and act accordingly, i.e. don't pay for concert tickets for a friend
and expect your friend to be able to enter the arena with her wallet.
As Tom Harding noted, it is possible to transfer keys to your friend's
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal all
keys in that tree. Another solution is that your friend forwards the
PoP request to your wallet, through twitter or SMS, and you send the
PoP for her. Maybe that forwarding mechanism can be built into wallets
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.
Of course the simplest solution would be to send money to your friend
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
Post by Pieter Wuille
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying, and
that knowledge of that token is used to gain access to the services
you
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
provide.
That token would then be reusable. Someone stealing it would be able
to use it as much as she wants. That is what I want to avoid with PoP.
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on this
list on Mars 13 that I think covers most pros and cons of the
different approaches.
While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the wallet
that pays. Otherwise you would need to keep it in another safe place,
remember it's reusable. Where would that be? How would you transfer
that token to your friend?
Thank you again for your comments. I appreciate it.
Best regards,
Kalle
Post by Pieter Wuille
--
Pieter
Kalle Rosenbaum
2015-06-17 09:51:54 UTC
Permalink
Post by Pieter Wuille
I don't see why existing software could create a 40-byte OP_RETURN but not
larger? The limitation comes from a relay policy in full nodes, not a
limitation is wallet software... and PoPs are not relayed on the network.
You are probably right here. The thing is that I don't know how *all*
wallet signing and validating software is written, so I figure it's
better to stick to a "valid" output. Since I don't *need* more data
than 40 bytes, why bother. There's another constraint to this as well:
The other BIP proposal, "Proof of Payment URI scheme", includes a
nonce parameter in the URI. If the nonce is very long, the QR code
will be unnecessarily big. The server should try to detect a brute
force of the 48 bit nonce, or at least delay the pop requests by some
100 ms or so.

Do you think this is an actual problem, and why? Is your suggestion to
use a bigger nonce, given the above?
Post by Pieter Wuille
Regarding sharing, I think you're talking about a different use case. Say
you want to pay for 1-week valid entrance to some venue. I thought the
purpose of the PoP was to be sure that only the person who paid for it, and
not anyone else can use it during that week.
That's right. That's one use case. You pay for the 1-week entrance and
then you use your wallet to sign PoPs when you enter the venue.
Post by Pieter Wuille
My argument against that is that the original payer can also hand the
private keys in his wallet to someone else, who would then become able to
create PoPs for the service. He does not lose anything by this, assuming the
address is not reused.
Yes, that is possible. It's about the same as giving out a
username/password for a service that you have paid for. In the case of
a concert ticket, it's simple. Just allow one entrance per payment.
But in the example you gave, it's a bit more complicated. You could
for example give all guests a bracelet upon first entry or upon first
exit. Or you can put a stamp on people leaving the venue, and demand
that all re-entries show the stamp, possibly along with a new PoP.
Pretty much as is done already. Different use cases will need
different protection. In this example, the value added by PoP is that
the venue does not have to distribute tickets in advance. This in turn
allows for better privacy for the customer, who don't have to give out
personal information such as an email-address.
Post by Pieter Wuille
So, using a token does not change anything, except it can be provided to the
payer - instead of relying on creating an implicit identity based on who
seems to have held particular private keys in the past.
Yes, that's a difference, but it comes at the cost of security. The
stolen token can be used over and over. In the case of PoP it's only
usable once, and it's only created when it's actually needed,
minimizing the window of opportunity for the thief.

Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
You can't avoid sharing the token, and you can't avoid sharing the private
keys used for signing either. If they are single use, you don't lose
anything by sharing them.
Forwarding the PoP request would be a way to avoid sharing keys, as
suggested above.
Post by Pieter Wuille
Also you are not creating a real transaction. Why does the OP_RETURN
limitation matter?
This was discussed in the beginning of this thread: "The idea is to
simplify implementation. Existing software can be used as is to sign
and validate PoPs"
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Thank you for your comments Pieter! Please find my answers below.
Post by Pieter Wuille
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin. Maybe
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction corresponds
to
a
single payment. This is true for simple wallet use cases, but not compatible
with CoinJoin, or with systems that for example would want to combine
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the likes.
Post by Pieter Wuille
48 bits seems low to me, but it does indeed solve the problem. Why not
128
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited to
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then
have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue a
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet who held
the coins is the payer/buyer. That's what I said earlier; you're implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not necessary. The
receiver should not care who paid or how, he should care what was payed
for.
You are saying that it's a problem that the wallet used to pay, must
also be used to issue the PoP? That may very well be a problem in some
cases. People using PoP should of course be aware of it's limitations
and act accordingly, i.e. don't pay for concert tickets for a friend
and expect your friend to be able to enter the arena with her wallet.
As Tom Harding noted, it is possible to transfer keys to your friend's
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal all
keys in that tree. Another solution is that your friend forwards the
PoP request to your wallet, through twitter or SMS, and you send the
PoP for her. Maybe that forwarding mechanism can be built into wallets
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.
Of course the simplest solution would be to send money to your friend
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
Post by Pieter Wuille
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying,
and
that knowledge of that token is used to gain access to the services you
provide.
That token would then be reusable. Someone stealing it would be able
to use it as much as she wants. That is what I want to avoid with PoP.
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on this
list on Mars 13 that I think covers most pros and cons of the
different approaches.
While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the wallet
that pays. Otherwise you would need to keep it in another safe place,
remember it's reusable. Where would that be? How would you transfer
that token to your friend?
Thank you again for your comments. I appreciate it.
Best regards,
Kalle
Post by Pieter Wuille
--
Pieter
------------------------------------------------------------------------------
Kalle Rosenbaum
2015-06-21 14:39:24 UTC
Permalink
Hi Greg!

After a lot of constructive discussion, feedback and updating, I'm
requesting that you please assign these proposals BIP numbers. It's both
the "Proof of Payment" proposal and the "Proof of Payment URI scheme"
proposal that I'm referring to.

The wikimedia source is available here:
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP.

Is this what you need in order to proceed or is there something else you
need from me?

Best regards,
/Kalle
Post by Kalle Rosenbaum
Post by Pieter Wuille
I don't see why existing software could create a 40-byte OP_RETURN but
not
Post by Pieter Wuille
larger? The limitation comes from a relay policy in full nodes, not a
limitation is wallet software... and PoPs are not relayed on the network.
You are probably right here. The thing is that I don't know how *all*
wallet signing and validating software is written, so I figure it's
better to stick to a "valid" output. Since I don't *need* more data
The other BIP proposal, "Proof of Payment URI scheme", includes a
nonce parameter in the URI. If the nonce is very long, the QR code
will be unnecessarily big. The server should try to detect a brute
force of the 48 bit nonce, or at least delay the pop requests by some
100 ms or so.
Do you think this is an actual problem, and why? Is your suggestion to
use a bigger nonce, given the above?
Post by Pieter Wuille
Regarding sharing, I think you're talking about a different use case. Say
you want to pay for 1-week valid entrance to some venue. I thought the
purpose of the PoP was to be sure that only the person who paid for it,
and
Post by Pieter Wuille
not anyone else can use it during that week.
That's right. That's one use case. You pay for the 1-week entrance and
then you use your wallet to sign PoPs when you enter the venue.
Post by Pieter Wuille
My argument against that is that the original payer can also hand the
private keys in his wallet to someone else, who would then become able to
create PoPs for the service. He does not lose anything by this, assuming
the
Post by Pieter Wuille
address is not reused.
Yes, that is possible. It's about the same as giving out a
username/password for a service that you have paid for. In the case of
a concert ticket, it's simple. Just allow one entrance per payment.
But in the example you gave, it's a bit more complicated. You could
for example give all guests a bracelet upon first entry or upon first
exit. Or you can put a stamp on people leaving the venue, and demand
that all re-entries show the stamp, possibly along with a new PoP.
Pretty much as is done already. Different use cases will need
different protection. In this example, the value added by PoP is that
the venue does not have to distribute tickets in advance. This in turn
allows for better privacy for the customer, who don't have to give out
personal information such as an email-address.
Post by Pieter Wuille
So, using a token does not change anything, except it can be provided to
the
Post by Pieter Wuille
payer - instead of relying on creating an implicit identity based on who
seems to have held particular private keys in the past.
Yes, that's a difference, but it comes at the cost of security. The
stolen token can be used over and over. In the case of PoP it's only
usable once, and it's only created when it's actually needed,
minimizing the window of opportunity for the thief.
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
You can't avoid sharing the token, and you can't avoid sharing the private
keys used for signing either. If they are single use, you don't lose
anything by sharing them.
Forwarding the PoP request would be a way to avoid sharing keys, as
suggested above.
Post by Pieter Wuille
Also you are not creating a real transaction. Why does the OP_RETURN
limitation matter?
This was discussed in the beginning of this thread: "The idea is to
simplify implementation. Existing software can be used as is to sign
and validate PoPs"
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Thank you for your comments Pieter! Please find my answers below.
On Mon, Jun 15, 2015 at 1:59 PM, Kalle Rosenbaum <
Post by Kalle Rosenbaum
I'm not sure if we will be able to support PoP with CoinJoin.
Maybe
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction
corresponds
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
to
a
single payment. This is true for simple wallet use cases, but not
compatible
with CoinJoin, or with systems that for example would want to
combine
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the likes.
48 bits seems low to me, but it does indeed solve the problem. Why not
128
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited to
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Kalle Rosenbaum
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me,
and
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Pieter Wuille
then
have
the shop insist that I can't drink it because I'm not the buyer.
If you pay as you use the service (ie pay for coffee upfront), there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you issue
a
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet
who
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
held
the coins is the payer/buyer. That's what I said earlier; you're implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not
necessary.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
The
receiver should not care who paid or how, he should care what was payed
for.
You are saying that it's a problem that the wallet used to pay, must
also be used to issue the PoP? That may very well be a problem in
some
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
cases. People using PoP should of course be aware of it's limitations
and act accordingly, i.e. don't pay for concert tickets for a friend
and expect your friend to be able to enter the arena with her wallet.
As Tom Harding noted, it is possible to transfer keys to your
friend's
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal all
keys in that tree. Another solution is that your friend forwards the
PoP request to your wallet, through twitter or SMS, and you send the
PoP for her. Maybe that forwarding mechanism can be built into
wallets
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.
Of course the simplest solution would be to send money to your friend
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying,
and
that knowledge of that token is used to gain access to the services you
provide.
That token would then be reusable. Someone stealing it would be able
to use it as much as she wants. That is what I want to avoid with
PoP.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on this
list on Mars 13 that I think covers most pros and cons of the
different approaches.
While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the
wallet
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
that pays. Otherwise you would need to keep it in another safe place,
remember it's reusable. Where would that be? How would you transfer
that token to your friend?
Thank you again for your comments. I appreciate it.
Best regards,
Kalle
--
Pieter
Kalle Rosenbaum via bitcoin-dev
2015-07-24 06:55:12 UTC
Permalink
These BIPs have been assigned 120 and 121:

120: Proof of Payment
121: Proof of Payment URI scheme

Regards,
Kalle
120: Proof of Payment
121: Proof of Payment URI scheme
Regards,
Kalle
Post by Kalle Rosenbaum
Hi Greg!
After a lot of constructive discussion, feedback and updating, I'm
requesting that you please assign these proposals BIP numbers. It's both
the "Proof of Payment" proposal and the "Proof of Payment URI scheme"
proposal that I'm referring to.
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP.
Is this what you need in order to proceed or is there something else you
need from me?
Best regards,
/Kalle
Post by Kalle Rosenbaum
Post by Pieter Wuille
I don't see why existing software could create a 40-byte OP_RETURN but
not
Post by Pieter Wuille
larger? The limitation comes from a relay policy in full nodes, not a
limitation is wallet software... and PoPs are not relayed on the
network.
You are probably right here. The thing is that I don't know how *all*
wallet signing and validating software is written, so I figure it's
better to stick to a "valid" output. Since I don't *need* more data
The other BIP proposal, "Proof of Payment URI scheme", includes a
nonce parameter in the URI. If the nonce is very long, the QR code
will be unnecessarily big. The server should try to detect a brute
force of the 48 bit nonce, or at least delay the pop requests by some
100 ms or so.
Do you think this is an actual problem, and why? Is your suggestion to
use a bigger nonce, given the above?
Post by Pieter Wuille
Regarding sharing, I think you're talking about a different use case.
Say
Post by Pieter Wuille
you want to pay for 1-week valid entrance to some venue. I thought the
purpose of the PoP was to be sure that only the person who paid for
it, and
Post by Pieter Wuille
not anyone else can use it during that week.
That's right. That's one use case. You pay for the 1-week entrance and
then you use your wallet to sign PoPs when you enter the venue.
Post by Pieter Wuille
My argument against that is that the original payer can also hand the
private keys in his wallet to someone else, who would then become able
to
Post by Pieter Wuille
create PoPs for the service. He does not lose anything by this,
assuming the
Post by Pieter Wuille
address is not reused.
Yes, that is possible. It's about the same as giving out a
username/password for a service that you have paid for. In the case of
a concert ticket, it's simple. Just allow one entrance per payment.
But in the example you gave, it's a bit more complicated. You could
for example give all guests a bracelet upon first entry or upon first
exit. Or you can put a stamp on people leaving the venue, and demand
that all re-entries show the stamp, possibly along with a new PoP.
Pretty much as is done already. Different use cases will need
different protection. In this example, the value added by PoP is that
the venue does not have to distribute tickets in advance. This in turn
allows for better privacy for the customer, who don't have to give out
personal information such as an email-address.
Post by Pieter Wuille
So, using a token does not change anything, except it can be provided
to the
Post by Pieter Wuille
payer - instead of relying on creating an implicit identity based on
who
Post by Pieter Wuille
seems to have held particular private keys in the past.
Yes, that's a difference, but it comes at the cost of security. The
stolen token can be used over and over. In the case of PoP it's only
usable once, and it's only created when it's actually needed,
minimizing the window of opportunity for the thief.
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
You can't avoid sharing the token, and you can't avoid sharing the private
keys used for signing either. If they are single use, you don't lose
anything by sharing them.
Forwarding the PoP request would be a way to avoid sharing keys, as
suggested above.
Post by Pieter Wuille
Also you are not creating a real transaction. Why does the OP_RETURN
limitation matter?
This was discussed in the beginning of this thread: "The idea is to
simplify implementation. Existing software can be used as is to sign
and validate PoPs"
Regards,
Kalle
Post by Pieter Wuille
Post by Kalle Rosenbaum
Thank you for your comments Pieter! Please find my answers below.
On Mon, Jun 15, 2015 at 1:59 PM, Kalle Rosenbaum <
2015-06-15 12:00 GMT+02:00 Pieter Wuille <
I'm not sure if we will be able to support PoP with CoinJoin.
Maybe
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
someone with more insight into CoinJoin have some input?
Not really. The problem is that you assume a transaction
corresponds
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
to
a
single payment. This is true for simple wallet use cases, but not
compatible
with CoinJoin, or with systems that for example would want to
combine
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
multiple payments in a single transaction.
Yes, you are right. It's not compatible with CoinJoin and the
likes.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
48 bits seems low to me, but it does indeed solve the problem.
Why
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
not
128
or 256 bits?
The nonce is limited because of the OP_RETURN output being limited
to
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
40 bytes of data: 2 bytes version, 32 bytes txid, 6 bytes nonce.
Post by Pieter Wuille
Why does anyone care who paid? This is like walking into a
coffeshop,
noticing I don't have money with me, let me friend pay for
me, and
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
then
have
the shop insist that I can't drink it because I'm not the
buyer.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
If you pay as you use the service (ie pay for coffee upfront),
there's
no need for PoP. Please see the Motivation section. But you are right
that you must have the wallet(s) that paid at hand when you
issue a
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
PoP.
Post by Pieter Wuille
Track payments, don't try to assign identities to payers.
Please elaborate, I don't understand what you mean here.
I think that is a mistake. You should not assume that the wallet
who
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
held
the coins is the payer/buyer. That's what I said earlier; you're
implicitly
creating an identity (the one who holds these keys) based on the
transaction. This seems fundamentally wrong to me, and not
necessary.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
The
receiver should not care who paid or how, he should care what was payed
for.
You are saying that it's a problem that the wallet used to pay,
must
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
also be used to issue the PoP? That may very well be a problem in
some
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
cases. People using PoP should of course be aware of it's
limitations
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
and act accordingly, i.e. don't pay for concert tickets for a
friend
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
and expect your friend to be able to enter the arena with her
wallet.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
As Tom Harding noted, it is possible to transfer keys to your
friend's
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
wallet, but that might not be desirable if those keys are also used
for other payments. Also that would weaken the security of an HD
wallet, since a chain code along with a private key would reveal
all
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
keys in that tree. Another solution is that your friend forwards
the
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
PoP request to your wallet, through twitter or SMS, and you send
the
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
PoP for her. Maybe that forwarding mechanism can be built into
wallets
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
and automated so that the wallet automatically suggests to sign the
PoP for your friend. This is probably something to investigate
further, but not within the scope of this BIP.
Of course the simplest solution would be to send money to your
friend
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
first so that she can pay for the ticket from her own wallet, but
that's not always feasible.
The easiest solution to this IMHO would be an extension to the payment
protocol that gives you (or your wallet) a token in return for paying,
and
that knowledge of that token is used to gain access to the
services
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
you
provide.
That token would then be reusable. Someone stealing it would be
able
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
to use it as much as she wants. That is what I want to avoid with
PoP.
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
The BIP proposal briefly mentions something like this in the
rationale. I also had a discussion about this with Mike Hearn on
this
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
list on Mars 13 that I think covers most pros and cons of the
different approaches.
While your suggestion does indeed separate the transaction from the
proof of payment, it also assumes that the token is held in the
wallet
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
that pays. Otherwise you would need to keep it in another safe
place,
Post by Pieter Wuille
Post by Kalle Rosenbaum
Post by Pieter Wuille
Post by Kalle Rosenbaum
remember it's reusable. Where would that be? How would you transfer
that token to your friend?
Thank you again for your comments. I appreciate it.
Best regards,
Kalle
--
Pieter
Sriram Karra via bitcoin-dev
2015-07-27 08:14:43 UTC
Permalink
On Fri, Jul 24, 2015 at 12:25 PM, Kalle Rosenbaum via bitcoin-dev <
Did you break open the bubbly? From the outside it certainly looked harder
than everything else about this proposal combined.
Kalle Rosenbaum via bitcoin-dev
2015-07-26 21:13:49 UTC
Permalink
(Resending to the new bitcoin-dev list after sending to the old list)
Then why do you assume they have a policy limit that not even bitcoin core
itself maintains (the default limit was moved from 42 to 83 [counting the
op_return and pushes])?
The policy check is not a consensus rule. Other implementations may have
another default or not have a limit at all.
Thank you for pointing this out.

That's right. Bitcoin core now support 80 bytes data by default. And
yes, I was wrong in assuming 40 bytes policy in all implementations,
even if 40 bytes was the limit in bitcoin core at the time of writing
the BIP.

If there's a need to increase the size of the nonce, for example to
128 bits instead of the 48 bits as designed in BIP 120, then we can of
course do that, either now or in a subsequent version of PoP.

As noted before though, a longer nonce also means bigger QR codes
generated from the BIP 121 URIs. So I think that 48 bits is a good
tradeoff right now. And as stated in BIP120, a server generating PoP
requests should try to detect brute force attacks, or at least delay
the response (containing the nonce) by some 100 ms or so.

Do you think we need a bigger nonce? In that case, why?

If PoP later becomes an extension of BIP70, then there is no such size
constraint on the nonce, since it will be part of some kind of (e.g.)
PopRequest message and not contained in a QR encoded URI.

/Kalle
Jorge Timón via bitcoin-dev
2015-07-27 09:08:48 UTC
Permalink
Post by Kalle Rosenbaum via bitcoin-dev
Do you think we need a bigger nonce? In that case, why?
I don't know, it wasn't me that proposed a bigger nonce. I just wanted to
point out that the policy limit shouldn't be a concern.
Kalle Rosenbaum via bitcoin-dev
2015-07-27 11:21:38 UTC
Permalink
Ok, Thanks
Post by Jorge Timón via bitcoin-dev
Post by Kalle Rosenbaum via bitcoin-dev
Do you think we need a bigger nonce? In that case, why?
I don't know, it wasn't me that proposed a bigger nonce. I just wanted to
point out that the policy limit shouldn't be a concern.
Tom Harding
2015-06-16 05:26:03 UTC
Permalink
Shared wallets were discussed earlier as a feature. If you pay a for
dry cleaning with a shared wallet, a different 1-of-N signer can pick up
the clothes with no physical transfer of a claim check, by proving the
money that paid for the cleaning was his.

Many kinds of vouchers can be eliminated, because the money itself can
be vouched for, wirelessly, with ECDSA security. A PoP would be much
more difficult to forge as a valet claim check, to steal a car.

Something like your coffee gift example was also mentioned. The buyer
could export the private keys to your (the beneficiary's) wallet after
the purchase, by using an 'export gift claim check' function on the
spent transaction. Then you pick up the coffee (car, concert seats...)
just as if you had paid.

Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.

Coinjoin or simulfunding transactions wouldn't be PoP-able (nor should
they be) since no one signer has all the private keys.
Post by Pieter Wuille
I did misunderstand that. That changes things significantly.
However, having paid is not the same as having had access to the input
coins. What about shared wallets or coinjoin?
Also, if I understand correctly, there is no commitment to anything
you're trying to say about the sender? So once I obtain a
proof-of-payment from you about something you paid, I can go claim
that it's mine?
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and
then have the shop insist that I can't drink it because I'm not the buyer.
Track payments, don't try to assign identities to payers.
Hi Pieter!
It is intended to be a proof that you *have paid* for something. Not
that you have the intent to pay for something. You cannot use PoP
without a transaction to prove.
So, yes, it's just a proof of access to certain coins that you no
longer have.
Maybe I don't understand you correctly?
/Kalle
Now that you have removed the outputs, I don't think it's even a
intent of
payment, but just a proof of access to certain coins.
Post by Kalle Rosenbaum
Hi all!
I have made the discussed changes and updated my implementation
(https://github.com/kallerosenbaum/poppoc) accordingly. These
are the
Post by Kalle Rosenbaum
* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block
height lock
Post by Kalle Rosenbaum
time).
The comments so far has been mainly positive or neutral. Are
there any
Post by Kalle Rosenbaum
major objections against any of the two proposals? If not, I
will ask
Post by Kalle Rosenbaum
Gregory Maxwell to assign them BIP numbers.
The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The source
Post by Kalle Rosenbaum
for the Proof of Payment BIP proposal is also in-lined below.
* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID
Given this list, I still think "Proof of Payment" is the most
descriptive
Post by Kalle Rosenbaum
to non-technical people.
Regards,
Kalle
#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it
has the
Post by Kalle Rosenbaum
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to
prove that you
Post by Kalle Rosenbaum
* A pre-paid hotel room where your PoP functions as a key to
the door.
Post by Kalle Rosenbaum
* An online video rental service where you pay for a video and
watch it on
Post by Kalle Rosenbaum
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks
exclusivity. During
Post by Kalle Rosenbaum
this period you can upload new content to the sign whenever you
like using
Post by Kalle Rosenbaum
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates
itself using
Post by Kalle Rosenbaum
PoP.
* A lottery where all participants pay to the same address, and
the winner
Post by Kalle Rosenbaum
is selected among the transactions to that address. You
exchange the prize
Post by Kalle Rosenbaum
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc)
being
Post by Kalle Rosenbaum
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless
of script
Post by Kalle Rosenbaum
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock
all the
Post by Kalle Rosenbaum
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease
adoption.
Post by Kalle Rosenbaum
* In BIP0070, the PaymentRequest together with the transactions
fulfilling
Post by Kalle Rosenbaum
the request makes some sort of proof. However, it does not meet
1, 2 or 4
Post by Kalle Rosenbaum
and it obviously only meets 3 if the payment is made through
BIP0070. Also,
Post by Kalle Rosenbaum
there's no standard way to request/provide the proof. If
standardized it
Post by Kalle Rosenbaum
would probably meet 5.
* Signing messages, chosen by the server, with the private keys
used to
Post by Kalle Rosenbaum
sign the transaction. This could meet 1 and 2 but probably not
3. This is
Post by Kalle Rosenbaum
not standardized either. 4 Could be met if designed so.
If an input script type is P2SH, any satisfying script should
do, just as
Post by Kalle Rosenbaum
if it was a payment. For M-of-N multisig scripts, that would
mean that any
Post by Kalle Rosenbaum
set of M keys should be sufficient, not neccesarily the same
set of M keys
Post by Kalle Rosenbaum
that signed the transaction. This is important because strictly
demanding
Post by Kalle Rosenbaum
the same set of M keys would defeat the purpose of a multisig
address.
Post by Kalle Rosenbaum
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is
used to
Post by Kalle Rosenbaum
prove that one has ownership of the credentials needed to
unlock all the
Post by Kalle Rosenbaum
inputs of T. It has the exact same structure as a bitcoin
transaction with
Post by Kalle Rosenbaum
the same inputs as T and in the same order as in T, but with
each sequence
Post by Kalle Rosenbaum
number set to 0. There is exactly one output, here called the
pop output,
Post by Kalle Rosenbaum
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently
0x01 0x00
Post by Kalle Rosenbaum
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The lock_time of the PoP must be set to 499999999 to prevent
the PoP from
Post by Kalle Rosenbaum
being included in a block, should it appear on the bitcoin p2p
network. This
Post by Kalle Rosenbaum
is also the reason for setting the sequence numbers to 0, since
sequence
Post by Kalle Rosenbaum
number of ffffffff would make lock_time ineffective. This
specification
Post by Kalle Rosenbaum
demands that all input sequence numbers are 0, not just one of
them, which
Post by Kalle Rosenbaum
would be sufficient to make lock_time effective. This is for
simplicity
Post by Kalle Rosenbaum
reasons.
An illustration of the PoP data structure and its original
payment is
Post by Kalle Rosenbaum
shown below.
<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+
PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used
for bitcoin
Post by Kalle Rosenbaum
transactions.
The purpose of the nonce is to make it harder to use a stolen
PoP; Once
Post by Kalle Rosenbaum
the PoP has reached the server, that PoP is useless since the
server will
Post by Kalle Rosenbaum
generate a new nonce for every PoP request.
=== Process ===
# A proof of payment request is sent from the server to the
wallet. The
Post by Kalle Rosenbaum
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof
for. For
Post by Kalle Rosenbaum
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a
BIP0070
Post by Kalle Rosenbaum
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise
it asks
Post by Kalle Rosenbaum
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the
user to
Post by Kalle Rosenbaum
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with
“valid” or
Post by Kalle Rosenbaum
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not
specified
Post by Kalle Rosenbaum
here. Instead that is specified in separate specifications. See
[btcpop
Post by Kalle Rosenbaum
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every
new PoP
Post by Kalle Rosenbaum
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or
"invalid".
Post by Kalle Rosenbaum
That process is outlined below. If any step fails, the
validation is aborted
Post by Kalle Rosenbaum
# Check the format of the PoP. It must pass normal transaction
checks,
Post by Kalle Rosenbaum
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have
value 0
Post by Kalle Rosenbaum
and conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in
transaction
Post by Kalle Rosenbaum
T, except that the sequence numbers must all be 0. The ordering
of the
Post by Kalle Rosenbaum
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you
actually
Post by Kalle Rosenbaum
want proof for. If you don’t know exactly what transaction you
want proof
Post by Kalle Rosenbaum
for, check that the transaction actually pays for the
product/service you
Post by Kalle Rosenbaum
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change any
parameter in it.
Post by Kalle Rosenbaum
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label
that your
Post by Kalle Rosenbaum
wallet doesn't have any record for, resulting in a broken
service. Always
Post by Kalle Rosenbaum
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the
PoP request,
Post by Kalle Rosenbaum
and try to use the service hoping to get a matching nonce.
Probability per
Post by Kalle Rosenbaum
try: 1/(2^48). The server should have a mechanism for detecting
a brute
Post by Kalle Rosenbaum
force attack of this kind, or at least slow down the process by
delaying the
Post by Kalle Rosenbaum
PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a
generator
Post by Kalle Rosenbaum
for PoPs. This makes it important to keep the security of the
wallet after
Post by Kalle Rosenbaum
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id for a payment than the client's wallet. In that
case the
Post by Kalle Rosenbaum
wallet will not be able to prove the transaction to the server.
Wallets
Post by Kalle Rosenbaum
should not rely on the transaction id of the outgoing
transaction. Instead
Post by Kalle Rosenbaum
it should listen for the transaction on the network and put
that in its list
Post by Kalle Rosenbaum
of transactions.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
URI Scheme
[https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki
Payment Protocol
[[btcpop scheme BIP]]
#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no
outputs from
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to
0. I
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
2015-06-06 19:00 GMT+02:00 Kalle Rosenbaum
Post by Kalle Rosenbaum
On Jun 6, 2015 8:05 AM, "Kalle Rosenbaum"
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant
because the
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
- Start the proof script, which should be invalid, with a magic
constant and
include space for future expansion. This makes PoP's easy
to identify
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop,
so it
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
will simply treat it as one. I did add a 2 byte version
field to make
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
Post by Kalle Rosenbaum
it extendable.
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
Post by Kalle Rosenbaum
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
Kalle Rosenbaum
2015-06-16 12:12:49 UTC
Permalink
Post by Tom Harding
Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.
Do you mean that it will be hard to explain to merchants that they
must check the nonce in the PoP so that it matches the nonce in the
pop request? I think not, this is a commonly used pattern that anyone
should be able to grasp. Anyway, merchants will probably use a library
(though yet non-existing) for PoP, that will hide the gory details. I
also think that payment providers may want to add PoP to their
offering to customers (merchants).

Regards,
/Kalle
Post by Tom Harding
I did misunderstand that. That changes things significantly.
However, having paid is not the same as having had access to the input
coins. What about shared wallets or coinjoin?
Also, if I understand correctly, there is no commitment to anything you're
trying to say about the sender? So once I obtain a proof-of-payment from you
about something you paid, I can go claim that it's mine?
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then have
the shop insist that I can't drink it because I'm not the buyer.
Track payments, don't try to assign identities to payers.
Hi Pieter!
It is intended to be a proof that you *have paid* for something. Not
that you have the intent to pay for something. You cannot use PoP
without a transaction to prove.
So, yes, it's just a proof of access to certain coins that you no longer
have.
Maybe I don't understand you correctly?
/Kalle
Now that you have removed the outputs, I don't think it's even a intent
of
payment, but just a proof of access to certain coins.
Post by Kalle Rosenbaum
Hi all!
I have made the discussed changes and updated my implementation
(https://github.com/kallerosenbaum/poppoc) accordingly. These are the
* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block height lock
time).
The comments so far has been mainly positive or neutral. Are there any
major objections against any of the two proposals? If not, I will ask
Gregory Maxwell to assign them BIP numbers.
The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The source
for the Proof of Payment BIP proposal is also in-lined below.
* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID
Given this list, I still think "Proof of Payment" is the most descriptive
to non-technical people.
Regards,
Kalle
#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that you
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.
* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
If an input script type is P2SH, any satisfying script should do, just as
if it was a payment. For M-of-N multisig scripts, that would mean that any
set of M keys should be sufficient, not neccesarily the same set of M keys
that signed the transaction. This is important because strictly demanding
the same set of M keys would defeat the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs as T and in the same order as in T, but with each sequence
number set to 0. There is exactly one output, here called the pop output,
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The lock_time of the PoP must be set to 499999999 to prevent the PoP from
being included in a block, should it appear on the bitcoin p2p network.
This
is also the reason for setting the sequence numbers to 0, since sequence
number of ffffffff would make lock_time ineffective. This specification
demands that all input sequence numbers are 0, not just one of them,
which
would be sufficient to make lock_time effective. This is for simplicity
reasons.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+
PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for bitcoin
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is aborted
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have value 0
and conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, except that the sequence numbers must all be 0. The ordering of the
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change any parameter in it.
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label that your
wallet doesn't have any record for, resulting in a broken service. Always
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the PoP request,
and try to use the service hoping to get a matching nonce. Probability per
try: 1/(2^48). The server should have a mechanism for detecting a brute
force attack of this kind, or at least slow down the process by
delaying the
PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id for a payment than the client's wallet. In that case the
wallet will not be able to prove the transaction to the server. Wallets
should not rely on the transaction id of the outgoing transaction.
Instead
it should listen for the transaction on the network and put that in its
list
of transactions.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
URI Scheme
Payment Protocol
[[btcpop scheme BIP]]
#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic
constant and
include space for future expansion. This makes PoP's easy to
identify
and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
Kalle Rosenbaum
2015-06-16 12:31:19 UTC
Permalink
Another thing worth mentioning is that an SPV wallet cannot validate a
PoP without fetching the input transactions of the PoP from an
external (not bitcoin network) source, for example chain.com or some
other trusted full node's API.

The validation of the PoP depends on the external source(s) being
honest. It can make a valid pop look invalid, but it cannot make an
invalid pop look valid.

/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.
Do you mean that it will be hard to explain to merchants that they
must check the nonce in the PoP so that it matches the nonce in the
pop request? I think not, this is a commonly used pattern that anyone
should be able to grasp. Anyway, merchants will probably use a library
(though yet non-existing) for PoP, that will hide the gory details. I
also think that payment providers may want to add PoP to their
offering to customers (merchants).
Regards,
/Kalle
Post by Tom Harding
I did misunderstand that. That changes things significantly.
However, having paid is not the same as having had access to the input
coins. What about shared wallets or coinjoin?
Also, if I understand correctly, there is no commitment to anything you're
trying to say about the sender? So once I obtain a proof-of-payment from you
about something you paid, I can go claim that it's mine?
Why does anyone care who paid? This is like walking into a coffeshop,
noticing I don't have money with me, let me friend pay for me, and then have
the shop insist that I can't drink it because I'm not the buyer.
Track payments, don't try to assign identities to payers.
Hi Pieter!
It is intended to be a proof that you *have paid* for something. Not
that you have the intent to pay for something. You cannot use PoP
without a transaction to prove.
So, yes, it's just a proof of access to certain coins that you no longer
have.
Maybe I don't understand you correctly?
/Kalle
Now that you have removed the outputs, I don't think it's even a intent
of
payment, but just a proof of access to certain coins.
Post by Kalle Rosenbaum
Hi all!
I have made the discussed changes and updated my implementation
(https://github.com/kallerosenbaum/poppoc) accordingly. These are the
* There is now only one output, the "pop output", of value 0.
* The sequence number of all inputs of the PoP must be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP must be set to 499999999 (max block height lock
time).
The comments so far has been mainly positive or neutral. Are there any
major objections against any of the two proposals? If not, I will ask
Gregory Maxwell to assign them BIP numbers.
The two BIP proposals can be found at
https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP and
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP. The source
for the Proof of Payment BIP proposal is also in-lined below.
* Proof of Potential
* Proof of Control
* Proof of Signature
* Signatory Proof
* Popo: Proof of payment origin
* Pots: Proof of transaction signer
* proof of transaction intent
* Declaration of intent
* Asset-access-and-action-affirmation, AAaAA, or A5
* VeriBit
* CertiBTC
* VBit
* PayID
Given this list, I still think "Proof of Payment" is the most descriptive
to non-technical people.
Regards,
Kalle
#################################################
<pre>
BIP: <BIP number>
Title: Proof of Payment
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This BIP describes how a wallet can prove to a server that it has the
ability to sign a certain transaction.
== Motivation ==
There are several scenarios in which it would be useful to prove that you
* A pre-paid hotel room where your PoP functions as a key to the door.
* An online video rental service where you pay for a video and watch it on
any device.
* An ad-sign where you pay in advance for e.g. 2 weeks exclusivity. During
this period you can upload new content to the sign whenever you like using
PoP.
* Log in to a pay site using a PoP.
* A parking lot you pay for monthly and the car authenticates itself using
PoP.
* A lottery where all participants pay to the same address, and the winner
is selected among the transactions to that address. You exchange the prize
for a PoP for the winning transaction.
With Proof of Payment, these use cases can be achieved without any
personal information (user name, password, e-mail address, etc) being
involved.
== Rationale ==
# A PoP should be generated on demand.
# It should only be usable once to avoid issues due to theft.
# It should be able to create a PoP for any payment, regardless of script
type (P2SH, P2PKH, etc.).
# It should prove that you have enough credentials to unlock all the
inputs of the proven transaction.
# It should be easy to implement by wallets and servers to ease adoption.
* In BIP0070, the PaymentRequest together with the transactions fulfilling
the request makes some sort of proof. However, it does not meet 1, 2 or 4
and it obviously only meets 3 if the payment is made through BIP0070. Also,
there's no standard way to request/provide the proof. If standardized it
would probably meet 5.
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
If an input script type is P2SH, any satisfying script should do, just as
if it was a payment. For M-of-N multisig scripts, that would mean that any
set of M keys should be sufficient, not neccesarily the same set of M keys
that signed the transaction. This is important because strictly demanding
the same set of M keys would defeat the purpose of a multisig address.
== Specification ==
=== Data structure ===
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T. It has the exact same structure as a bitcoin transaction with
the same inputs as T and in the same order as in T, but with each sequence
number set to 0. There is exactly one output, here called the pop output,
OP_RETURN <version> <txid> <nonce>
{|
! Field !! Size [B] !! Description
|-
| &lt;version> || 2 || Version, little endian, currently 0x01 0x00
|-
| &lt;txid> || 32 || The transaction to prove
|-
| &lt;nonce> || 6 || Random data
|}
The lock_time of the PoP must be set to 499999999 to prevent the PoP from
being included in a block, should it appear on the bitcoin p2p network.
This
is also the reason for setting the sequence numbers to 0, since sequence
number of ffffffff would make lock_time ineffective. This specification
demands that all input sequence numbers are 0, not just one of them,
which
would be sufficient to make lock_time effective. This is for simplicity
reasons.
An illustration of the PoP data structure and its original payment is
shown below.
<pre>
T
+------------------------------------------------+
|inputs | outputs |
| Value,Sequence | Value,Script |
+------------------------------------------------+
|input0 1,ffffffff | 0,pay to A |
|input1 3,ffffffff | 2,OP_RETURN <some data> |
|input2 4,ffffffff | 1,pay to B |
| | 4,pay to C |
+------------------------------------------------+
PoP(T)
+-------------------------------------------------------------+
| inputs | outputs |
| Value,Sequence | Value,Script |
+-------------------------------------------------------------+
|input0 1,00000000 | 0,OP_RETURN <version> <txid> <nonce> |
|input1 3,00000000 | |
|input2 4,00000000 | |
+-------------------------------------------------------------+
| lock_time=499999999 |
+-------------------------------------------------------------+
</pre>
The PoP is signed using the same signing process that is used for bitcoin
transactions.
The purpose of the nonce is to make it harder to use a stolen PoP; Once
the PoP has reached the server, that PoP is useless since the server will
generate a new nonce for every PoP request.
=== Process ===
# A proof of payment request is sent from the server to the wallet. The
## a random nonce
## a destination where to send the PoP, for example a https URL
## data hinting the wallet which transaction to create a proof for. For
##* txid, if known by the server
##* PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070
payment)
##* amount, label, message or other information from a BIP0021 URI
# The wallet identifies a transaction T, if possible. Otherwise it asks
the user to select among the ones that match the hints in 1.iii.
# The wallet creates an unsigned PoP (UPoP) for T, and asks the user to
sign it.
# The user confirms
# The UPoP(T) is signed by the wallet, creating PoP(T).
# The PoP is sent to the destination in 1.ii.
# The server receiving the PoP validates it and responds with “valid” or
“invalid”.
# The wallet displays the response in some way to the user.
'''Remarks:'''
* The method of transferring the PoP request at step 1 is not specified
here. Instead that is specified in separate specifications. See [btcpop
scheme BIP](btcpop scheme BIP).
* The nonce must be randomly generated by the server for every new PoP
request.
=== Validating a PoP ===
The server needs to validate the PoP and reply with "valid" or "invalid".
That process is outlined below. If any step fails, the validation is aborted
# Check the format of the PoP. It must pass normal transaction checks,
except that the inputs may already be spent.
# Check that lock_time is 499999999.
# Check that there is exactly one output. This output must have value 0
and conform to the OP_RETURN output format outlined above.
# Check that the nonce is the same as the one requested.
# Check that the inputs of the PoP are exactly the same as in transaction
T, except that the sequence numbers must all be 0. The ordering of the
inputs must also be the same as in T.
# Run the scripts of all the inputs. All scipts must return true.
# Check that the txid in the PoP output is the transaction you actually
want proof for. If you don’t know exactly what transaction you want proof
for, check that the transaction actually pays for the product/service you
deliver.
# Return "valid".
== Security considerations ==
* Someone can intercept the PoP-request and change any parameter in it.
** Pop destination - Stealing your PoP.
** label - Trick you to sign an unintended pop or set a label that your
wallet doesn't have any record for, resulting in a broken service. Always
check the PoP before signing.
** nonce - Your pop will not validate on server.
* Someone can steal a PoP, for example by tampering with the PoP request,
and try to use the service hoping to get a matching nonce. Probability per
try: 1/(2^48). The server should have a mechanism for detecting a brute
force attack of this kind, or at least slow down the process by
delaying the
PoP request by some 100 ms or so.
* Even if a wallet has no funds it might still be valuable as a generator
for PoPs. This makes it important to keep the security of the wallet after
it has been emptied.
* Transaction malleability may cause the server to have another
transaction id for a payment than the client's wallet. In that case the
wallet will not be able to prove the transaction to the server. Wallets
should not rely on the transaction id of the outgoing transaction.
Instead
it should listen for the transaction on the network and put that in its
list
of transactions.
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
URI Scheme
Payment Protocol
[[btcpop scheme BIP]]
#########################################################
Post by Kalle Rosenbaum
Thank you all for the feedback.
* There will be only one output, the "pop output", and no outputs from
T will be copied to the PoP.
* The pop output will have value 0.
* The sequence number of all inputs of the PoP will be set to 0. I
chose to set it to 0 for all inputs for simplicity.
* The lock_time of the PoP is always set to 499999999.
Any comments on this?
/Kalle
Post by Kalle Rosenbaum
Post by Tom Harding
Post by Kalle Rosenbaum
I'm open to changes here.
- Don't include any real outputs. They are redundant because the
txid is
already referenced.
with the nLocktime solution, the copied outputs are not needed.
Post by Tom Harding
- Start the proof script, which should be invalid, with a magic
constant and
include space for future expansion. This makes PoP's easy to
identify
and
extend.
I did remore the constant (a "PoP" literal ascii encoded string)
because it didn't add much. The recipient will expect a pop, so it
will simply treat it as one. I did add a 2 byte version field to make
it extendable.
Post by Tom Harding
- "Proof of Potential"
Noted :-)
Thank you
/Kalle
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
Tom Harding
2015-06-16 14:05:01 UTC
Permalink
Post by Kalle Rosenbaum
Post by Tom Harding
Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.
Do you mean that it will be hard to explain to merchants that they
must check the nonce in the PoP so that it matches the nonce in the
pop request?
Sorry for the idiomatic language. No, I just meant that you have
thought it out in detail! You standardize a latent capability of the
cryptosystem. It seems very powerful for some classes of users.



------------------------------------------------------------------------------
Kalle Rosenbaum
2015-06-16 16:22:40 UTC
Permalink
Thank you for the clarification Tom!

/Kalle
Post by Tom Harding
Post by Kalle Rosenbaum
Post by Tom Harding
Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.
Do you mean that it will be hard to explain to merchants that they
must check the nonce in the PoP so that it matches the nonce in the
pop request?
Sorry for the idiomatic language. No, I just meant that you have
thought it out in detail! You standardize a latent capability of the
cryptosystem. It seems very powerful for some classes of users.
------------------------------------------------------------------------------
Luke Dashjr
2015-06-06 15:18:18 UTC
Permalink
Post by Kalle Rosenbaum
* Signing messages, chosen by the server, with the private keys used to
sign the transaction. This could meet 1 and 2 but probably not 3. This is
not standardized either. 4 Could be met if designed so.
It's also not secure, since the signed messages only prove ownership of the
address associated with the private key, and does not prove ownership of
UTXOs currently redeemable with the private key, nor prove past UTXOs spent
were approved by the owner of the address.
Post by Kalle Rosenbaum
A proof of payment for a transaction T, here called PoP(T), is used to
prove that one has ownership of the credentials needed to unlock all the
inputs of T.
This appears to be incompatible with CoinJoin at least. Maybe there's some
clean way to avoid that by using
https://github.com/Blockstream/contracthashtool ?
Post by Kalle Rosenbaum
It has the exact same structure as a bitcoin transaction with
the same inputs and outputs as T and in the same order as in T. There is
also one OP_RETURN output inserted at index 0, here called the pop output.
I also agree with Pieter, that this should *not* be so cleanly compatible
with Bitcoin transactions. If you wish to share code, perhaps using an
invalid opcode rather than OP_RETURN would be appropriate.

Luke

------------------------------------------------------------------------------
Pieter Wuille
2015-06-06 15:23:48 UTC
Permalink
Post by Luke Dashjr
I also agree with Pieter, that this should *not* be so cleanly compatible
with Bitcoin transactions. If you wish to share code, perhaps using an
invalid opcode rather than OP_RETURN would be appropriate.
Using an invalid opcode would merely send funds into the void. It wouldn't
invalidate the transaction.
--
Pieter
Peter Todd
2015-06-06 15:32:47 UTC
Permalink
Post by Pieter Wuille
Post by Luke Dashjr
I also agree with Pieter, that this should *not* be so cleanly compatible
with Bitcoin transactions. If you wish to share code, perhaps using an
invalid opcode rather than OP_RETURN would be appropriate.
Using an invalid opcode would merely send funds into the void. It wouldn't
invalidate the transaction.
Just set nLockTime to 500000000-1 and nSequence appropriately to make
the transaction impossible to mine for the next 9500 years.

Though I agree that this whole idea seems a bit dubious to me.
--
'peter'[:-1]@petertodd.org
00000000000000000000dd919214b66444dcebb4aa0214c1ab7c8b3b633be71f
Kalle Rosenbaum
2015-06-06 16:35:50 UTC
Permalink
Post by Peter Todd
Post by Pieter Wuille
Post by Luke Dashjr
I also agree with Pieter, that this should *not* be so cleanly compatible
with Bitcoin transactions. If you wish to share code, perhaps using an
invalid opcode rather than OP_RETURN would be appropriate.
Using an invalid opcode would merely send funds into the void. It wouldn't
invalidate the transaction.
Just set nLockTime to 500000000-1 and nSequence appropriately to make
the transaction impossible to mine for the next 9500 years.
Actually, I suggested that on this list on april 27, but shortly after
rejected my own idea:

#######################
"Or a really high lock_time, but it would not make it invalid, just delayed."

Ok, this was a bad idea, since nodes would have to keep it in memory.
Please disregard that idea...
########################

Now I think I rejected it on based on a misunderstanding. Nodes will
not put them in their mempool unless it's value is near in time,
right? From the 0.9.0 release notes: "Accept nLockTime transactions
that finalize in the next block".

In that case this is a really nice option.
Post by Peter Todd
Though I agree that this whole idea seems a bit dubious to me.
--
00000000000000000000dd919214b66444dcebb4aa0214c1ab7c8b3b633be71f
------------------------------------------------------------------------------
_______________________________________________
Bitcoin-development mailing list
https://lists.sourceforge.net/lists/listinfo/bitcoin-development
------------------------------------------------------------------------------
Loading...