Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Improve spec on binding tokens to existing UTXOs #80

Closed
dr-orlovsky opened this issue Jun 25, 2019 · 9 comments
Closed

Improve spec on binding tokens to existing UTXOs #80

dr-orlovsky opened this issue Jun 25, 2019 · 9 comments
Assignees
Labels
01-rgb A3-core alekos-roadmap Comes from the original roadmap by @afilini enhancement help wanted
Milestone

Comments

@dr-orlovsky
Copy link
Contributor

In https://github.com/rgb-org/spec/blob/master/01-rgb.md#address-based-vs-utxo-based

Comment by Alekos:

By writing in a proof that the new "owner" of an RGB output is an external UTXO, it's possible to separate the flow of Bitcoins from the flow of assets:

  • Base version: writing which UTXO is the new owner
  • Obfuscation: Hide the UTXO until the proof is spent. This hides the UTXO from the sender (which creates the proof). Discussion: spec#59
@dr-orlovsky dr-orlovsky added enhancement help wanted 01-rgb alekos-roadmap Comes from the original roadmap by @afilini A3-core labels Jun 25, 2019
@dr-orlovsky dr-orlovsky added this to the v1.0.0 milestone Jun 25, 2019
@giacomozucco giacomozucco reopened this Jul 1, 2019
@dr-orlovsky dr-orlovsky added this to To do in RGB Jul 10, 2019
@dr-orlovsky dr-orlovsky moved this from To do to Initial discussion / brainstorming in RGB Jul 18, 2019
@dr-orlovsky
Copy link
Contributor Author

@afilini can you pls elaborate on this issue you've proposed in the roadmap?

@dr-orlovsky dr-orlovsky moved this from Initial discussion / brainstorming to Reviewer(s) approved / PR being prepared in RGB Jul 25, 2019
@dr-orlovsky dr-orlovsky moved this from Reviewer(s) approved / PR being prepared to Initial discussion / brainstorming in RGB Jul 25, 2019
@dr-orlovsky
Copy link
Contributor Author

Seems like the actual discussion are happening underneath PR #59. Copying the last proposal from there:

With the current RGB spec we can already spend assets to an existing UTXOs and have a separate flow of the assets independent from the flow of the bitcoins. This will not work for Spectrum, but completely fine for the on-chain transfers.

In order to obsucate UTXOs until the proofs are spent, we can use HMAC, as proposed in the mentioned PR #59 – but with a key for HMAC being the actual public key, corresponding to the UTXO address. This key is not known before the actual UTXO is spend — and when it is being spent, it becomes public, so no reason to add it to the proof, meaning there would be no size increase for the proof.

@dr-orlovsky
Copy link
Contributor Author

The actual RGB spec has to be improved in pay-to-existing UTXO part in a way that we need to have two states of the proof: an initial, with only HMAC_SHA256(utxo_public_key, txid:vout) serialized – which should be included into the proof commitment – with this data being replaced later, when the UTXO is spend, with the actual txid and vout in a non-hashed form. This will not break the commitment, since a verifying party would be able to compute HMAC the proof was committed to from these data + public key in the spent tx output (related issue: #98 )

@dr-orlovsky dr-orlovsky moved this from Initial discussion to Proposal under review in RGB Jul 26, 2019
@inaltoasinistra
Copy link
Collaborator

This key is not known before the actual UTXO is spend — and when it is being spent, it becomes public

It shoudn't become public after the UTXO is spent. The idea is that you require the the next proof to know the UTXO, so the sender will never know it

@dr-orlovsky
Copy link
Contributor Author

dr-orlovsky commented Jul 26, 2019

@inaltoasinistra, ok, let me re-phrase it in a correct way.

The proof is passes several stages.

  1. "Unspent proof": the proof is created by the payer (Alice). It receives from the payee (Bob) the hash, which is HMAC_SHA256(public_key, txid || vout) and includes it into the proof, committing to it with either P2C or OP_RETURN commitments. This proof is passed then to Bob and kept in this stage. Nobody else except Bob know where the bound asset, owned by Bob, resides.
  2. "Spent proof": when Bob needs to spend (part of) the asset to Carol, he changes the proof structure in the following way:
    • removes original HMAC_SHA256 and replaces it with explicit txid:vout information
    • spends the UTXO to which the proof was bound, making public_key explicitly available in bitcoin blockchain to everybody who knows the original UTXO (at this point nobody except Bob himself

After this operation Bob transfers updated proof + a newly created proof to Carol. Now Carol also knows which output Bob has spent and had his assets bound to – but this is unavoidable anyway in order to verify the proof and prevent double spend. Original payee, Alice, still do not know which UTXO was used.

Will this work?

@inaltoasinistra
Copy link
Collaborator

Original payee, Alice, still do not know which UTXO was used.

Alice can discover which is the UTXO computing the hash on all the outputs of the blockchain with the same rule. When she finds the correct hash she knows the UTXO.
This operation is cheap, a bitcoin node uses more resources

@dr-orlovsky
Copy link
Contributor Author

True, but not when the payee (Bob) uses a new public hash (HD-derived, for instance). And since it is in his interest to preserve the privacy, he will do that.

@inaltoasinistra
Copy link
Collaborator

Also new public keys are exposed when UTXOs are spent. So Alice could check all the public keys of new blocks until she found the correct key

@dr-orlovsky
Copy link
Contributor Author

After the team meeting at @inbitcoin it was decided to abandon this change, since
a) it does provide very limited temporally privacy trading on a lot of complexity
b) if the privacy is the concern, its better to adapt some best practices from zero-knowledge proofs, like in confidential assets.

RGB automation moved this from Proposal under review to Done Aug 9, 2019
@dr-orlovsky dr-orlovsky removed this from Done in RGB Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
01-rgb A3-core alekos-roadmap Comes from the original roadmap by @afilini enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants