Read a known CosmWasm storage key without invoking a smart query

Raw state inspection can help debug a contract whose public query interface omits a setting. It requires the precise key serialization used by that version of the contract.

Read the bytes of a documented key

Suppose the implementation stores a value under the literal ASCII key config. Its base64 representation is Y29uZmln. Set CONTRACT to the instance and GRPC to a wasmd TLS gRPC endpoint with reflection.

grpcurl -d "{\"address\":\"$CONTRACT\",\"queryData\":\"Y29uZmln\"}" "$GRPC" cosmwasm.wasm.v1.Query/RawContractState

Decode response data from base64. Interpret it using the contract’s storage format. If this version serializes a JSON object, parse that JSON only after decoding the bytes. An empty response warrants checking the exact key.

Avoid guessing map keys from display names

A map namespace and composite keys can include prefixes, lengths or binary integers. Reading the printable label alone can miss the real entry. A migration can also change the private storage layout while keeping the public smart query stable. github.com wasmd Query API