Skip to content

Use Pink Extension

Introduction

All the unique capabilities of Phat Contract are implemented in pink-extension. Informally speaking:

$ Phat\ Contract = ink! + Pink\ Extension $

It is worth noting that the Phat Contract is not a trivial extension of ink! contract since all these extra functions only work under the off-chain computation.

Pink Extension Functions

FunctionalityFunction NameQuery SupportTransaction Support
Internet Accesshttp_requestβœ…βŒ
Cryptogetrandomβœ…βŒ
ecdsa_sign_prehashedβœ…βœ…
ecdsa_verify_prehashedβœ…βœ…
sign (ecdsa/ed25519)βœ…βœ…
sign (sr25519)βœ…βŒ
verifyβœ…βœ…
derive_sr25519_keyβœ…βœ…
get_public_keyβœ…βœ…
Volatile Cachecache_setβœ…βœ…
cache_set_expireβœ…βœ…
cache_getβœ…βŒ
cache_removeβœ…βœ…
Misclogβœ…βœ…
is_running_in_commandβœ…βœ…

Refer to our Phat Hello World contract to see how you can import these functions to your contract.