I don’t know, but i wonder why someone would not want to encrypt the slatepack in step 1. My view was always that you want to have it encrypted, except for maybe some special cases where it might be preferred to not need encryption from one party, eg. donations via RSR. Do you know of any case where it would make sense to not encrypt SRS step1 slatepack?
Yes, maybe offering an unsolicited payment to a friend or posting first reply first serve giveaways on a forum, for casual purposes I think I would use unaddressed SRS more often than any other format.
I’m not even sure if a slatepack actually converts to human readable data, but I know that some info like sent amount is in there somehow, and I would like to be able to extract it.
SlatepackMessage armor payloads are encoded similar to legacy bitcoin addresses, with the primary differences being that the SimpleBase58Check used here does not include version bytes and includes the error checking code at the beginning of the payload instead of at the end.
SHA256(SHA256(SLATEPACK_MESSAGE_BINARY))
First four bytes from previous step are ERROR_CHECK_CODE
The Writeable implementation is how it is encoded into binary and the Readable part is how it is decoded from a binary. All the special encoding/decoding can be found above e.g. for SigsWrapRef or SlateOptFields.
Field amount is u64 so it’s 8 bytes. The 4 bytes on the left of your highlight are all filled with zeros. The next byte has a value of 00000110. You can guess if that’s the status as defined here grin-wallet/v4_bin.rs at master · mimblewimble/grin-wallet · GitHub
It might be if you have only the amount and fee values.
Btw, the status field is a bitmask of which fields in SlateOptFields to expect when you read. Your mark of 110 means it will contain amount and fee, so the Readable part first reads status bitmask and from this knows how many bytes to read and what they represent.
Regarding our limits, that’s a good point, I’ve added a hard fork event to my calendar.
I had to correct the comments above. I wrote as 0x first which is in hexadecimal, but you don’t write bits in this mode. It’s simply just 1110, so no 0x prefix.
So is there anything in an unaddressed slatepack that is unique to the sender?
i.e. if two different wallets of identical version both create an unaddressed send .1 grin slatepack, will they create an identical slatepack?
I suspect the answer is no, but it would be interesting if it was yes. There would then be generic transaction starting slatepacks. If it is no, then I am curious what the unique information is that’s involved.
I will test this myself when I get around to loading two wallets.
Each slate gets assigned a when it is created UUID which is a part of the slate. We store slate related data that is private to us (some private keys we create to sign the slate later) in a structure called Context. This is also where the wallet remembers the amount associated to a slate.