Move.

Post

Share your knowledge.

skywinder.
Apr 10, 2025
Expert Q&A

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
2
3
Share
Comments
.

Answers

3
BigDev.
Aug 15 2025, 16:53

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

2
Comments
.
mssoni.
Apr 11 2025, 08:43

Native 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.

1
Comments
.

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.

270Posts616Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.