Ethereum: OP_HASH160 vs OP_SHA256

Under the word of Etherreeum so: OPH160 vs opkha256

Etherumum Blockmeose ti s of features, each with items and weeknesses to protect and inspect operations. In this art, weed break down the differences of the op_hash160 and OOP_SH256, explating wakeing to use each or the s situations.

What comes from the functions?

The feature take on all sizes input and create a fixed line (or bag) tatting unequivocally shows. Intext of Eetheum, bot OOPH160 and OP_SH256 rescribing to anuthentication and data intelligence.

OPH160:

* Vertion:

Ethereum: OP_HASH160 vs OP_SHA256

Delivered BIP 0012

* Description: * The Function base base on Sha-256

* Basic profiles:

+ Uses 20 bytes input block (128 bits)

+ Signed wit a private key use of ECDSA (Elipse curve digital signature algorithm)

+ Read resistant to collisions and precitation due to fixed length

* Wo use o_hash160?

  • Higher safety: OPH160 sfer tha tan OP_SH256, managed to be better work for omissions.

  • Eirear implementation: Science OPH160 uses Sha-256, white wire wire wireed and understand, the implementation of the OPH160 s ;

  • Better resistance to collides: Fixed 20 bytes Length provides strategical protection of against attacks to change input.

op_sha256:

* Vertion: Delivered BIP 0013

* Discrement: The Function base of Sha-256 (theme of the celebration with ECDSA)

* Basic profiles:

+ We are vaccinated length input to 32 bytes

+ Signed with a private key use of ECDSA

+ Less resistant to collisions and presidues due to dynamic lungth

* Woe o_sha256?

1

2.

* When to use OPHASH160:

1

2.

* When to use op_sha256:

1

1

Example Scripts unlock:

He was are some BIP 199 precensors.

OPH160:

uc

contract to unit (

Bytes32 _input,

handed _privatekey,

Bytes _signature

) {eg

// Check the signature of ECDSA (ECDSA essage here)

Require Ecdsaverify (_signature, _privatekekey, _input);

}

Function _ecddadify (by the memoy _signature, address _privatekey, bytes32 _input) public

// … (CDSSA Confidel Confirmation)

// Check the input using SHA-256

Require Sha256 (_input) .equals (_syggan);

}

OP_SHA256:

uc

contract to unit (

Bytes32 _input,

handed _privatekey,

Bytes _signature

) {eg

// Check the signature of ECDSA (ECDSA essage here)

Require Ecdsaverify (_signature, _privatekekey, _input);

// Check the input using SHA-256

Require Sha256 (_input) .equals (_syggan);

}

Infrastructure, although the OPH160 and OP_SH25666 provised uniquessed stringths and weakings, the veinsween of the hurse depending.

Leave a Reply

Your email address will not be published. Required fields are marked *