Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 3.53 KB

CDS_standardness_proposal.md

File metadata and controls

73 lines (51 loc) · 3.53 KB
  BIP: 
  Layer: 
  Title: 
  Author: 
  Comments-Summary: No comments yet.
  Comments-URI: 
  Status: Draft
  Type: 
  Created: 2020-10-12
  License: 

Abstract

The purpose of this proposal is getting a commitment to eliminate the restriction that enforces scriptPubkey of an Unspent Transaction Output (UTXO) of format <sig> <msg> <pubkey> OP_CHECKDATASIGVERIFY to be considered as "non-standard". That restriction has to be lifted so the template will become one of standard UTXO formats.

Motivation

The primary motivation for the proposal comes from a need to build a locking scripts that are primarily based on a signature for an arbitrary message. As of this moment, all the "non-standard" locking scripts are executed within scriptSig (unlocking part), whereas the locking part stays as a "standard" P2SH. However, <sig> <msg> <pubkey> OP_CHECKDATASIGVERIFY locking script is very straighforward and moreover allows indexing and querying the UTXOs without having to actually spend them.

Problem example

One example of such a use case is the current inabiltity to associate SLP fungible and non-fungible tokens with each other.

Every type of SLP transaction (GENESIS, MINT, SEND) for both tokens types (Token Type 1 and NFT1) use OP_RETURN to store their token information. SLP transactions are rendered invalid if any extrenous data are added to their OP_RETURN information. This makes it impossible to combine other metadata or to mix multiple token protocols within a single Bitcoin Cash transaction. Moreover, there is no any other implied way to store arbitrary data on bitcoin cash blockchain within SLP transactions.

Problem actors: Account1, Account2

Steps to reproduce the problem:

  • Create an SLP defined Token Type 1 (Fungible) token (Token Type 1 GENESIS transaction) - TokenFun (N amount owned by Account1)
  • Create an SLP defined NFT "Group" token (NFT Group GENESIS Transaction)
  • Instantiate X number of SLP defined NFT child tokens to X number of transaction outputs (one per output) (NFT Group SEND Transaction)
  • Create an SLP defined NFT "Child" token (NFT Child GENESIS Transaction) - TokenNFTChild1 (owned by Account2)
  • Send N of TokenFun from Account1 to Account2 and assosiate the amount N of TokenFun to the specific TokenNFTChild1

Single OP_RETURN is already being used by SLP defined TokenFun token. This leaves no way to add metadata that creates an association between the SLP defined NTF1 and SLP defined Token Type 1.

Proposed solution: Add an additional output to the transaction (following <sig> <msg> <pubkey> OP_CHECKDATASIGVERIFY scriptPubkey template) that points to the TokenNFTChild1 token ID in its msg, whose sig signature is done using Account2's credentials, which is its GENESIS transaction hash. OP_CHECKDATASIG is beneficial in this case as it brings the BCH compliance protocol protection by checking the msg's correctness that other alternative approaches do not.

Specification

This BIP proposes to eliminate the restriction that enforces scriptPubkey of an Unspent Transaction Output (UTXO) of format <sig> <msg> <pubkey> OP_CHECKDATASIGVERIFY to be considered as "non-standard".

Risks

Compatibility

This proposal is backward compatible.

Reference implementation

Copyright