plutus
plutus copied to clipboard
Add a builtin for potential PR
Area
[x] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code [x] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries [] Marlowe Related to Marlowe [] Other Any other topic (Playgrounds, etc.)
Describe the feature you'd like
We (myself and @arthurgreef) are reviewing Cardano and would like to create, locally, additional builtins similar to addInteger that would be available to smart-contracts that work with big numbers. We are looking for guidance on where to start to implement or the various 'touchpoints' that need to be put in place so it would be visible to contract development.
For example we would like to add something similar to a^b mod c (mod exp).
Describe alternatives you've considered
Additional context / screenshots
would like to create, locally, additional builtins similar to addInteger that would be available to smart-contracts that work with big numbers.
Sorry, but may ask what for?
Of course you can implement them locally for your local contracts, but they won't work on mainnet.
We would like to use a RSA Accumulator to implement a scaleable contract to track tokenized assets in supply chains. For this we need modular math operations such as mod exp and mod inverse. We also need a big number isprime test (in GMP library).
Two years later (sorry, we are setting up proper GitHub monitoring only now)... In order to add a builtin you only need to edit one file, PlutusCore.Default.Builtins, following the pattern and the docs.
I'm closing this issue, but let me know if you need any help, I'll do my best.