GithubHelp home page GithubHelp logo

Comments (5)

KtorZ avatar KtorZ commented on June 26, 2024 2

hex-encoded byte strings are no longer byte strings, they are text strings. Hex encoding is meant to turn any raw binary data into something that is text-friendly using a restricted alphabet (and so are base32, base58, base64 and other similar encoding).

What is ultimately stored on the blockchain are not hex-encoded text strings, it's raw bytes (as in, an array of unsigned integer values spanning over 8 bits, or simply put, u8). The main reason being that (a) it's a lot more compact and (b) it's a lot more flexible. Programs have many efficient primitives to deal with byte buffers; working with text strings however is usually inefficient.

from cips.

Tenancio avatar Tenancio commented on June 26, 2024 2

@KtorZ Thanks for that reply, it has answered my question!

@rphair I think now I understand more an example is probably not necessary.

Thanks for your help!

from cips.

thaddeusdiamond avatar thaddeusdiamond commented on June 26, 2024 1

I will let @alessandrokonrad and @KtorZ weigh in but in my opinion bytestrings are preferred to hex encoded bytestrings so that flexible encodings can be specified. That said, that would probably require an encoding field in the CDDL which I do not see so if policy ID and asset name are only ever referenced as hex encodings in the spec, I think that change could be made.

As for the asset name specifically I know @alessandrokonrad has done work on CIP-0068 that requires linking assets via naming conventions which had some delimiter constraints (using a bytearray sequence), so that is why the raw bytes there.

from cips.

rphair avatar rphair commented on June 26, 2024

cc @alessandrokonrad @thaddeusdiamond @KtorZ

from cips.

rphair avatar rphair commented on June 26, 2024

@Tenancio the last response seems complete... does this answer your question properly? Or do you still think it's important that a "real world example" be included in the CIP? It seems to me that the example isn't necessary because people will generally understand what's meant by a sequence of bytes (and I don't see how an example could be chosen to generally represent a sequence of unsigned 8-bit values anyway).

from cips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.