docs: Interoperable Address Serialization Guide#37
Open
0xteddybear wants to merge 5 commits into
Open
Conversation
| 7. Serialize the address, in this case 20 raw bytes: `[D8DA6BF26964AF9D7EED9E03E53415D37AA96045]`. | ||
| 8. Compute the length of the above, in this case `20 == 0x14` | ||
| 9. Append the length as a single byte: `[0001 03 000001 14]` | ||
| 10. Append the address from step 7: `[0001 03 000001 D8DA6BF26964AF9D7EED9E03E53415D37AA96045]` |
Collaborator
There was a problem hiding this comment.
Suggested change
| 10. Append the address from step 7: `[0001 03 000001 D8DA6BF26964AF9D7EED9E03E53415D37AA96045]` | |
| 10. Append the address from step 7: `[0001 03 000001 14 D8DA6BF26964AF9D7EED9E03E53415D37AA96045]` |
missing address length
| ``` | ||
|
|
||
| 1. Take the first two bytes and interpret them as a big-endian integer: `0x0001 == 1`. We know how to parse version 1, so we can proceed. Remaining payload: `[22000245296998a6f8e2a784db5d9f95e18fc23f70441a1039446801089879b08c7ef0205333498d5aea4ae009585c43f7b8c30df8e70187d4a713d134f977fc8dfe0b5]` | ||
| 2. Take the next byte, `0x22 == 34`. This is the length of the chainid. Remaining payload: `[205333498d5aea4ae009585c43f7b8c30df8e70187d4a713d134f977fc8dfe0b5]` |
Collaborator
There was a problem hiding this comment.
Suggested change
| 2. Take the next byte, `0x22 == 34`. This is the length of the chainid. Remaining payload: `[205333498d5aea4ae009585c43f7b8c30df8e70187d4a713d134f977fc8dfe0b5]` | |
| 2. Take the next byte, `0x22 == 34`. This is the length of the chainid. Remaining payload: `[000245296998a6f8e2a784db5d9f95e18fc23f70441a1039446801089879b08c7ef0205333498d5aea4ae009585c43f7b8c30df8e70187d4a713d134f977fc8dfe0b5]` |
remaining payload fix
0xArdy
reviewed
Apr 16, 2025
| - Interoperable Address sans the 'version' field is `000122000245296998a6f8e2a784db5d9f95e18fc23f70441a1039446801089879b08c7ef0205333498d5aea4ae009585c43f7b8c30df8e70187d4a713d134f977fc8dfe0b5`. | ||
| - The keccak256 of the above is `0xaa7e9354e0bdd58d51688fdbcba0e4a77efe398198e1683752f1c1188e44d90d` | ||
| - First 4 bytes, in uppercase base16: `AA7E9354` | ||
| 4. Tying it all together: `5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d@solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d#AA7E9354` |
There was a problem hiding this comment.
Suggested change
| 4. Tying it all together: `5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d@solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d#AA7E9354` | |
| 4. Tying it all together: `MJKqp326RZCHnAAbew9MDdui3iCKWco7fsK9sVuZTX2@solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d#AA7E9354` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.