Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid key/value data types #31

Open
d47081 opened this issue Feb 15, 2024 · 4 comments
Open

Valid key/value data types #31

d47081 opened this issue Feb 15, 2024 · 4 comments

Comments

@d47081
Copy link

d47081 commented Feb 15, 2024

By decoding raw transactions in kvazar app, found that data types like integer, boolean, null and others available in blockchain

It is a bug of or feature (can't find any documentation)

If that's bug/hole, where no validation available in wallet DTH input, users able to insert any data base58 encoded maybe it's could be the answer to:

kvazar-network/crawler#1
#24 (comment)

@d47081 d47081 changed the title key/value data type Supported key/value data types Feb 15, 2024
@d47081 d47081 changed the title Supported key/value data types Valid key/value data types Feb 15, 2024
@canrnd
Copy link

canrnd commented Feb 21, 2024

There is no set data types so a key/value can be anything as long as you can serialize it. This means the application reading/creating the data should handle expectations accordingly weather it be input validations or processing/rendering. While normally not an issue for purpose built applications it does make things tricky for things like explorers if they do not know how data for a namespace is meant to be handled.

@canrnd
Copy link

canrnd commented Feb 21, 2024

Also in reference to #24 I think what you are seeing as hidden records is a key update when same key is used over again. Core wallet will only provide back the most recent through the namespace commands however if blocks themselves are processed you can reveal the complete history. My explorer goes by blocks and showcases this: https://keva.one/NWn2wUdctLvoatDuqFmcfxEuJmFx9EbSre

I'm unfamiliar with kvazar but at first glance does look like a bug. The transaction decodes for me as namespace: NPRhzHUT8VfSaqwX4ZQvY5bxhsqS8z9NXa
key: key4
value: eos

@d47081
Copy link
Author

d47081 commented Feb 21, 2024

Thank you for reply,

yes it should work, because binary is also string and finally the data encoded with base58 there

but getting error like could not parse incoming data when trying to send binary with kevaPut using this library
tried to play with curl flags but no success and can send the data string encoded to base64 only (that more expensive)

p.s. is your explorer open source?

@canrnd
Copy link

canrnd commented Feb 21, 2024

The jsonrpc interface expects strings which is why error occurring when binary data passed in. If the input data is binary then base64 going to be needed here to ensure data remains as expected. Although if data coming from a text input you may be able to avoid base64 but would require some validations that could fall back to base64 in event input data can't just be passed in. I haven't built web interface yet to really see what kinda quirks might arise though (my apps so far build raw transactions for processing).

At the moment my explorer hasn't been made open, eventually I will have a variant of it made available to accent my open source wallet but that is a ways off yet. I always happy to share how I've addresses various challenges. If not yet in Kevacoin's Discord it is worth joining for easier dialog https://discord.gg/5zPHhbG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants