Language

Choose a language

/build/rpc / assets / raw_attach

rawtxattachzkchunk

rawtxattachzkchunk "hex" vout "asset_id" "vk_hash" chunk_index chunk_count "data" Attach a ZK_PARAMS_CHUNK TLV to the specified vout of a raw transaction. ZK chunks carry cryptographic verification key parameters for ZK proof validation. Arguments: 1. hex (string, required) Raw transaction hex 2. vout (numeric, required) Output index 3. asset_id (string, required) 32-byte asset id hex (no 0x) 4. vk_hash (string, required) 32-byte verification key hash (matches IssuerReg.vk_commitment) 5. chunk_index (numeric, required) Chunk index (0-based, u16) 6. chunk_count (numeric, required) Total chunk count (u16, max 8) 7. data (string, required) Chunk data (raw hex bytes) Result: "hex" (string) Modified hex Examples: > bitcoin-cli rawtxattachzkchunk "<hex>" 0 "<asset_id>" "<vk_hash>" 0 1 "<data_hex>"

Signature

rawtxattachzkchunk(hex: string, vout: number, asset_id: string, vk_hash: string, chunk_index: number, chunk_count: number, data: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"rawtxattachzkchunk","params":["\"<hex>\"",0,"\"<asset_id>\"","\"<vk_hash>\"",0,0,"\"<data>\""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
hexstringyesRaw transaction hex
voutnumberyesOutput index
asset_idstringyes32-byte asset id hex (no 0x)
vk_hashstringyes32-byte verification key hash (matches IssuerReg.vk_commitment)
chunk_indexnumberyesChunk index (0-based, u16)
chunk_countnumberyesTotal chunk count (u16, max 8)
datastringyesChunk data (raw hex bytes)

Result

Type:  any

"hex" (string) Modified hex

Source: services/core-node/bcore/src/rpc/rawtransaction.cpp:792

C++ symbol: rawtxattachzkchunk