{"id":59453,"library":"sp-runtime-interface","title":"SP Runtime Interface","description":"Substrate runtime interface for defining host functions and runtime APIs.","status":"active","version":"35.0.0","language":"rust","source_language":null,"source_url":"https://github.com/paritytech/polkadot-sdk","tags":["substrate","runtime","interface","blockchain"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nsp-runtime-interface = \"35.0.0\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add sp-runtime-interface","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"runtime_interface","correct":"use sp_runtime_interface::runtime_interface;"}],"quickstart":{"code":"use sp_runtime_interface::runtime_interface;\n\n#[runtime_interface]\ntrait MyInterface {\n    fn my_function(data: &[u8]) -> Vec<u8> {\n        data.to_vec()\n    }\n}\n\nfn main() {\n    let result = my_function(b\"hello\");\n    println!(\"{:?}\", result);\n}","lang":"rust","description":"Defines a runtime interface trait using the runtime_interface macro."},"warnings":[{"fix":"Ensure you are building a Substrate runtime and have the correct dependencies.","message":"Only works within a Substrate runtime environment; not for standalone use.","severity":"gotcha","affected_versions":">=35.0.0"}],"env_vars":null,"search_vec":"'api':13 'blockchain':17 'defin':8 'function':10 'host':9 'interfac':3,6,16 'runtim':2,5,12,15 'sp':1 'substrat':4,14","created_at":"2026-06-16T17:04:20.414332+00:00","updated_at":"2026-06-16T17:04:20.414332+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://paritytech.github.io/polkadot-sdk/","github":"https://github.com/paritytech/polkadot-sdk","docs":"https://docs.rs/sp-runtime-interface/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["crypto","other"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}