kevacoin-project / kevacoin

Kevacoin source tree
https://www.kevacoin.org
MIT License
32 stars 16 forks source link

How can I get _KEVA_NS_ value from the raw transaction? #22

Closed ghost closed 3 years ago

ghost commented 3 years ago

I need to decode _KEVANS value, but without local node running.

How can decode the raw transaction using Kevacoin Explorer API to replace keva_get method:

$hash = Base58Check::encode('356a893ac5dbc64229a0700d63b019c72e5227644d', false , 0 , false);
$nameSpace = $node->keva_get($hash, '_KEVA_NS_');

Thanks.

kevacoin-project commented 3 years ago

Sorry for the late reply. "_KEVANS" key doesn't really exist. It is a pseudo key, whose value is as in the namespace creation command keva_namespace <display_name>.

If you want to get the , you can get the it from the tx which contains the namespace creation.

Look for:

OP_KEVA_NAMESPACE 35fd152e7cf52109d28d060cab2a7cccfd669cebc7 4b657661636f696e20446562757473204f6666696369616c204d6173636f7420392f3130

The 4b657661636f696e20446562757473204f6666696369616c204d6173636f7420392f3130 is the value of _KEVA_NS_.

ghost commented 3 years ago

Thank you.

p.s. may be decoded using hex2bin function in PHP.