Comments (5)
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.
@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.
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.
cc @alessandrokonrad @thaddeusdiamond @KtorZ
from cips.
@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)
- CIP-0071 | Adjust preamble and structure w.r.t CIP-0001
- CIP-0381 | Adjust preamble and structure w.r.t CIP-0001
- CIP-0001 | Adjust preamble and structure w.r.t CIP-0001 HOT 1
- CIP-9999 | Adjust preamble and structure w.r.t CIP-0001 HOT 1
- CIP-1852 | Adjust preamble and structure w.r.t CIP-0001
- CIP-1853 | Adjust preamble and structure w.r.t CIP-0001
- CIP-1854 | Adjust preamble and structure w.r.t CIP-0001
- CIP-1855 | Adjust preamble and structure w.r.t CIP-0001
- Add References section to CIPs/CPSs HOT 10
- CIP-100: Make witnessing optional + add CIP-08 message signing HOT 5
- CIP-9999 | How to add Copyright to CPSs HOT 4
- CIP-0069: alternative approach HOT 10
- CIP-0072: Suggestions for improving dApp registration identity verification HOT 4
- CIP-100 | Canonical example is wrong HOT 3
- CIP 100 | Provide directions on how to create signatures for the body without circular dependencies. HOT 17
- Wiki: Initial topics + points to cover HOT 5
- CIP-0058: integers vs. byteStrings for cryptographic applications HOT 32
- Rendering errors on cips.cardano.org. HOT 2
- CIP-0013: Current state of integration and further advancements HOT 12
- CIP-0010 | Add schema links HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cips.