Open tarakby opened 7 months ago
Given the effort required to complete this (moving this as a separate contract, updating all contracts to import this) it is unlikely we can complete it in C1.0. It might need to stay where it is.
We might be able to do this in a non-breaking way, if we can make "import crypto" statement to work - then this would not be a breaking change.
I feel like if something breaking will be done here, better to moving native types ( HashAlgorithm.etc ) inside crypto in a native way. Crypto being pure Cadence has no value for the future. If we later have add something that is not in pure Cadence ( which seems pretty likely in the crypto context ) at least we can prevent polluting global namespace.
Issue to be solved
The
crypto
contract offers crypto tools that are fully developed in the cadence language and don't have to be built-in in the language. It makes more sense to take thecrypto
contract outside of the Cadence repo and add it as an independent standard library core-contract.This issue is a follow-up on the discussion in https://github.com/onflow/cadence/issues/1447#issuecomment-1863220320
Suggested Solution
Moving the Crypto contract out of Cadence will require:
No additional work in the contract itself is required, we had already previously refactored it to be deployable like any other contract