Post
Share your knowledge.
What's a native function and can we call them directly?
I've come across the term 'native function' in Move but can't find detailed information about it. I heard that they're declared in Move but defined externally, often in Rust. Does that mean they are internal functions that can't be called directly by wallets or other modules?
- Move CLI
- Move
Answers
3Native functions in Move are indeed declared within the language but they don't have a body because they're implemented outside of Move, usually in Rust. Despite this, if the native function is public, you can call it just like any other function. They aren't restricted to internal use only. You can invoke them as long as the necessary permissions and public access are in place.
In Move, a native function is a special kind of function that you declare inside a Move module but don’t actually write in Move language itself—instead, it’s implemented in Rust at the runtime level. These functions are usually used for performance-heavy operations or low-level tasks that can’t be efficiently or securely done in pure Move, like hashing, cryptographic checks, or certain arithmetic operations. While you can use native functions inside your Move modules just like regular functions, you can’t directly call them from a wallet or transaction like a normal entry function. They're not exposed for direct user interaction; instead, they're called internally by the module code you write when needed.
If you're building a module and call a native function inside it, users interacting with your module (through transactions or dApps) will indirectly make use of that native function. But the native logic itself runs under-the-hood in the Move VM, handled in Rust, not exposed directly in any way.
Here’s a small example of how you might declare a native function:
native public fun sha256(data: vector<u8>): vector<u8>;
This tells the Move compiler that sha256
exists, but the actual implementation lives in Rust inside the Sui VM. If you want to read more about native functions in Move and how they tie into the Sui runtime, check out the official docs:
https://docs.sui.io/learn/move/native-functions
https://github.com/MystenLabs/sui/tree/main/crates/sui-move-natives
This is especially useful when you're writing performance-sensitive modules that need cryptographic operations or advanced math.
In Sui's Move language, a native function is one you declare in a Move module but whose actual code lives outside in the underlying system, typically written in Rust for Sui’s virtual machine, handling low-level tasks like cryptography or system operations that Move’s high-level syntax can’t directly manage. You can call these functions directly from your Move code in other modules or scripts, just like regular Move functions, as long as they’re marked public and you import the module properly, so wallets and other contracts can use them without any special restrictions. For example, something like sui::hash::keccak256 is a native function you can call to hash data, and it’s accessible in your transactions or contracts as long as you reference it correctly. The catch is they’re predefined in Sui’s framework, so you can’t create your own native functions in Move; you’re limited to what the system provides, and their behavior depends on the Rust implementation. For more on how native functions work in Move and their usage
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.

- ... SUITucker+165
- ... SUIDpodium.js+156
- ... SUIGifted.eth+148
- ... SUIacher+107
- ... SUIcasey+88
- ... SUIMiniBob+65
- ... SUItheking+55