rgb-archive / spec

[OLD!] RGB Protocol specifications for Bitcoin-based digital assets
https://rgb-org.github.io/
147 stars 24 forks source link

Improve spec on contract deployment #104

Closed dr-orlovsky closed 5 years ago

dr-orlovsky commented 5 years ago

From the current spec it is unclear:

  1. How to deterministically define to which transaction the contract is committed: there is no field inside the contract to point to that address
  2. At this moment asset issuing transaction is external to contract commitment transaction, at least contract header contains the full issuance_utxo address, and nothing prevents the contract creator to commit to other than issuing transaction, while the assets will be assigned to an existing transaction.

These parts must be improved, at least some rationale behind the design has to be provided

dr-orlovsky commented 5 years ago

We discussed this issue with @giacomozucco and came to the following proposal:

  1. Contracts should be allowed to issue assets to an UTXO outside of the commitment tx
  2. The moment of the contract commitment is the moment of the asset issuance. Assets are assigned at this point to the issue_utxo
  3. Commitment tx should be added as a field into the contract header, but it can participate in the commitment itself (i.e. is not a part of the contract hash).
  4. Since (according to #87) asset_id "commits" to the contract commitment tx it serves as a protection from multiple contract deployments, since each contract deployment will result in a different set of the issued asset_ids
dr-orlovsky commented 5 years ago

The commit https://github.com/rgb-org/spec/commit/7db1a0e942058c5af64f5a9aabbd70eced912a77 provides solution to this issue