> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/mainnet/llms.txt

# Function external

Module: `noir_aztec::macros::functions`

```rust
pub comptime fn external(f: FunctionDefinition, f_type: CtString)
```

An external function is callable from outside the contract.

There are three types of external functions:

- private: executed client-side and preserve privacy
- public: executed by the sequencer and do not preserve privacy (like on the EVM)
- utility: helpers that are never executed on-chain, typically used for state queries

[`external`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.external.md) functions are the Aztec equivalent of a Solidity `external` function, though their behavior differs slightly for public, private and utiliy functions.

[`external`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.external.md) functions can also be made [`initializer`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.initializer.md) (for contract intialization), [`view`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.view.md) (for read-only behavior), [`authorize_once`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.authorize_once.md) (for basic access control) and [`only_self`](/aztec-nr-api/mainnet/noir_aztec/macros/functions/fn.only_self.md) (to prevent other contracts from calling them).
