| Crates.io | hyli-contract-sdk |
| lib.rs | hyli-contract-sdk |
| version | 0.14.0-rc3 |
| created_at | 2025-09-05 11:57:42.547045+00 |
| updated_at | 2025-09-15 12:43:22.889743+00 |
| description | Hyli smart contract SDK |
| homepage | https://hyli.org/ |
| repository | https://github.com/hyli-org/hyli/ |
| max_upload_size | |
| id | 1825407 |
| size | 103,031 |
In this crate you will find some helpers function to build your Smart Contract on Hyli.
🚧 This is work in progress, all of this is subject to changes. See examples for usages.
Some of the models are defined in hyli-model crates, which is re-exported by this crate.
For example, you can do either of these two:
use contract_sdk::ZkProgramInput;
// or
use hyli_model::ZkProgramInput;
It allows you to only depends on crate contract-sdk in your contract's code.
The inputs of the zkVM should be of type ZkProgramInput defined in
pub struct ZkProgramInput {
pub state: Vec<u8>,
pub identity: Identity,
pub tx_hash: TxHash,
pub private_blob: BlobData,
pub blobs: Vec<Blob>,
pub index: BlobIndex,
}
In guest.rs you will find 2 functions that are entry points of smart contracts. You should call at least one of them at the beginning of your contract.
pub fn init_raw<Action>(input: ZkProgramInput) -> (ZkProgramInput, Action)
pub fn init_with_caller<Action>(
input: ZkProgramInput,
) -> Result<(ZkProgramInput, StructuredBlob<Action>, Identity), String>
At the end of your contract, you need to output a HyliOutput, you can use the helper in utils.rs:
pub fn as_hyli_output(
input: ZkProgramInput,
new_state: State,
res: crate::RunResult,
) -> HyliOutput
You can find in erc20.rs and identity_prover.rs some structs & traits used to help building contracts of token transfers & identity providing.
These are only helpers to build new contracts, not required standards.