Architecture

Overview

XYXYX is built upon a fully blockchain-based iteration of the ERC-404 standard.

Every 1 full XYXYX is embodied by an ERC-721 token with a tokenURI that points to a unique Base64 string generated by XYHASH, which is permanently recorded on the blockchain and stored within the token’s metadata. This Base64 string encodes an SVG output, making it human-readable data.

As a result, XYXYX is generated, stored, and rendered fully on-chain, diverging from traditional practices that rely on off-chain storage solutions (such as IPFS).

How it works

Find below an architecture overview of XYXYX using the tokenURI of Xyxyx #1.

1. Token URI Base64 String

data:application/json;base64,eyJuYW1lIjogIlh5eHl4ICMxIiwgImRlc2NyaXB0aW9uIjogIiIsICJpbWFnZSI6ICJkYXRhOmltYWdlL3N2Zyt4bWw7YmFzZTY0LFBITjJaeUIzYVdSMGFEMGlOVEF3SWlCb1pXbG5hSFE5SWpVd01DSWdlRzFzYm5NOUltaDBkSEE2THk5M2QzY3Vkek11YjNKbkx6SXdNREF2YzNabklqNDhjbVZqZENCM2FXUjBhRDBpTVRBd0pTSWdhR1ZwWjJoMFBTSXlOVEJ3ZUNJZ1ptbHNiRDBpSXpBd01DSWdMejQ4Y21WamRDQjNhV1IwYUQwaU5UQWxJaUJvWldsbmFIUTlJakkxTUhCNElpQm1hV3hzUFNJak5EUmtaR05qSWlCMGNtRnVjMlp2Y20wOUluUnlZVzV6YkdGMFpTZ3dMQ0F5TlRBdU1EQXdNREF3S1NJZ0x6NDhjbVZqZENCM2FXUjBhRDBpTlRBbElpQm9aV2xuYUhROUlqSTFNSEI0SWlCbWFXeHNQU0lqT0RneU1qSXlJaUIwY21GdWMyWnZjbTA5SW5SeVlXNXpiR0YwWlNneU5UQXNJREkxTUM0d01EQXdNREFwSWlBdlBqeDBaWGgwSUhodGJHNXpQU0pvZEhSd09pOHZkM2QzTG5jekxtOXlaeTh5TURBd0wzTjJaeUlnZEhKaGJuTm1iM0p0UFNKMGNtRnVjMnhoZEdVb01qTXVNREF3TURBd0xETXpMakF3TURBd01Da2lJR1pwYkd3OUlpTm1abVlpSUdadmJuUXRabUZ0YVd4NVBTSkRiM1Z5YVdWeUlFNWxkeXhEYjNWeWFXVnlMRXgxWTJsa1lTQlRZVzV6SUZSNWNHVjNjbWwwWlhJc1RIVmphV1JoSUZSNWNHVjNjbWwwWlhJc2JXOXViM053WVdObElpQm1iMjUwTFhOcGVtVTlJakV3Y0hnaUlHWnZiblF0ZDJWcFoyaDBQU0ppYjJ4a0lqNHhQQzkwWlhoMFBqd3ZjM1puUGc9PSJ9

The Base64 string that encodes the token URI of the token, which is inscribed on-chain.

2. Base64 Decoded to JSON

{"name": "Xyxyx #1", "description": "", "image": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjUwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIyNTBweCIgZmlsbD0iIzAwMCIgLz48cmVjdCB3aWR0aD0iNTAlIiBoZWlnaHQ9IjI1MHB4IiBmaWxsPSIjNDRkZGNjIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLCAyNTAuMDAwMDAwKSIgLz48cmVjdCB3aWR0aD0iNTAlIiBoZWlnaHQ9IjI1MHB4IiBmaWxsPSIjODgyMjIyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNTAsIDI1MC4wMDAwMDApIiAvPjx0ZXh0IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMuMDAwMDAwLDMzLjAwMDAwMCkiIGZpbGw9IiNmZmYiIGZvbnQtZmFtaWx5PSJDb3VyaWVyIE5ldyxDb3VyaWVyLEx1Y2lkYSBTYW5zIFR5cGV3cml0ZXIsTHVjaWRhIFR5cGV3cml0ZXIsbW9ub3NwYWNlIiBmb250LXNpemU9IjEwcHgiIGZvbnQtd2VpZ2h0PSJib2xkIj4xPC90ZXh0Pjwvc3ZnPg=="}

When decoded the token URI's Base64 string, it generates a JSON file with a secondary Base64 string as ''image'':.

3. JSON Base64 Decoded to XLM

<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="250px" fill="#000" /><rect width="50%" height="250px" fill="#44ddcc" transform="translate(0, 250.000000)" /><rect width="50%" height="250px" fill="#882222" transform="translate(250, 250.000000)" /><text xmlns="http://www.w3.org/2000/svg" transform="translate(23.000000,33.000000)" fill="#fff" font-family="Courier New,Courier,Lucida Sans Typewriter,Lucida Typewriter,monospace" font-size="10px" font-weight="bold">1</text></svg>

When decoded the secondary Base64 string from the JSON file, it generates the XLM code that embodies the SVG output.

4. SVG Output

The SVG output generated by the XLM code.

An archive of all the 1 full XYXYX minted by the smart contract can be viewed here.

Last updated