Skip to content

restricting sighash flag used by signer with covenants #310

Open
@mr-zwets

Description

@mr-zwets

Currently the CashScript docs do not have any info on how to restrict the sighash flag used by signer with a covenant

Hashtype value is last byte of the sig

so you could do something like

function example(sig userSig){
  bytes userSighashFlag = userSig.split(63)[1];
  // SIGHASH_UTXOS = 0x20
  require(userSighashFlag  == 0x20);
}

I think the above is actually acceptably clear as code, but we'd need more info in the docs about when it make sense to restrict the sighash types and maybe extra explanation about how they work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions