Movatterモバイル変換


[0]ホーム

URL:


K

© 2025 Cardano Foundation

CIP-0127

ripemd-160 hashing in Plutus Core

Abstract

This CIP follows closely the (CIP-0101)1 and proposes an extension of the current Plutus functions with another hashing primitiveRIPEMD-160. Primary goal is to introduce compatibility with Bitcoin's cryptographic infrastructure.

Motivation: why is this CIP necessary?

Theintegration of the ECDSA and Schnorr signatures over the secp256k1 curve into Plutus was a significant step towards interoperability with Ethereum and Bitcoin ecosystems. However, full compatibility is still impossible due to the absence of theRIPEMD-160 hashing algorithm in Plutus interpreter, which is a fundamental component of Bitcoin's cryptographic framework.Most of common addresses in Bitcoin are derived from doublehashing procedure involvingSHA-256 followed byRIPEMD-160 function:

AddingRIPEMD-160 to Plutus would enhance the potential for cross-chain solutions between Cardano and Bitcoin blockchains and complements the set of primitives which we already have in that regard. It would allow for the verification of Bitcoin addresses and transactions on-chain. This addition enables also the verification of signed messages that identify the signer by the public key hash, which has not yet been witnessed on the Bitcoin blockchain.

The RIPEMD-160 is not only relevant to Bitcoin - other chains likeCosmos orBNB also use it for address generation.

Specification

This proposal aims to introduce a new built-in hash functionRIPEMD-160.

This function will be developed following theRIP-160 specification and will utilize thecryptonite

Sincecardano-base already relies oncryptonite in the context ofkeccak-256 we would like to exposeRIPEMD-160 through the same library, to facilitate its integration into Plutus.

More specifically, Plutus will gain the following primitive operation:

  • ripemd_160 :: ByteString -> ByteString

The input to this function can be aByteString of arbitrary size, and the output will be aByteString of 20 bytes.Note that this function aligns with the format of existing hash functions in Plutus, such asblake2b_256

Rationale: how does this CIP achieve its goals?

While theRIPEMD-160 function might be implemented in on-chain scripts, doing so would be computationally unfeasible.

The library, cryptonite, is not implemented by and under control of the Plutus team. However,

  • It is a library already used in the Plutus stack to expose KECCAK-256, and can be considered as a trustworthy implementation.
  • Its behaviour is predictable and computationally efficient. The cost of the function is linear with respect to the size of the message provided as input. This is the same behaviour that other hash functions exposed in plutus (blake, sha3, keccak-256) have.

Acceptance Criteria

  • Acardano-base binding is created for theripemd-160 function and included in a new version of the library.
  • A Plutus binding is created for theripemd_160 function and included in a new version of Plutus.
  • Integration tests, similar to those of the existing Plutus hash functions, are added to the testing infrastructure.
  • The function is benchmarked to assess its cost. As for other hash functions available in Plutus (blake2b, sha256 and keccak_256), we expect the cost ofripemd_160 to be linear with respect to the size of the message. The Plutus team determines the exact costing functions empirically.
  • The ledger is updated to include new protocol parameters to control costing of the new builtins.
    • Included within the haskell cardano-node implementation from10.1.1.
  • This CIP may transition to active status once the Plutus version containing theripemd_160 function is introduced in a node release and becomes available on Mainnet.
    • Enabled by Plomin hardfork

Implementation Plan

The Plutus team will develop the binding, integration tests, and benchmarks. The E2E tests will be designed and implemented collaboratively by the testing team, the Plutus team, and community members planning to use this primitive.

Copyright

This CIP is licensed under [Apache-2.0][https://www.apache.org/licenses/LICENSE-2.0].

Footnotes

  1. I did not hesitate to reuse parts of the original text of (CIP-0101)[../CIP-0101/README.md) without explicit quotations. This approach was approved by the original authors.


[8]
ページ先頭

©2009-2025 Movatter.jp