Skip to content

Hashing opcodes work on strings instead of byte arrays #6

@vostrnad

Description

@vostrnad

In your implementation of the script interpreter, hashing opcodes pop a stack item, convert it to a string and then hash it. However, in Bitcoin the stack items are always byte arrays, and interpreting them as strings results in inconsistencies.

For example, the script OP_0 OP_SHA256 should return the hash of an empty byte array, but it instead hashes the string "0".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions