bitcoin-nfts / bitcoin-colors

A sample NFT collection that shows the strong connection between Stacks and Bitcoin.
6 stars 2 forks source link

Rendering the SVG from the contract #17

Closed whoabuddy closed 1 year ago

whoabuddy commented 1 year ago

One step we need to look at is how the metadata will be handled.

If the contract returns SVG values, how will they be displayed compared to a current SIP-009 URI?

There are definitely some examples from other projects we can use here, this blog post is a good reference of other SVG-on-chain projects.

whoabuddy commented 1 year ago

From Jamil: having a non-standard SIP-009 function that returns image as SVG, and get-token-uri as SIP-009 standard does expect a URI to be passed in.

Done before: Stacks Plates

Jamil commented 1 year ago

STXPlates: https://explorer.stacks.co/txid/SP1CSHTKVHMMQJ7PRQRFYW6SB4QAW6SR3XY2F81PA.stxplates?chain=mainnet

(print "Each plate is represented on-chain as a 21x21 grid of pixels (drawn left-to-right, top-to-bottom). To get the pixel hex values for a token, get the string from image-by-token for that token. Each number in the string represents an index in the image-key list.")
whoabuddy commented 1 year ago

Two more projects for reference/examples:

whoabuddy commented 1 year ago

Noting that the original code is still in the stacks-svg repo and needs to be integrated with the Bitcoin Colors contract.

whoabuddy commented 1 year ago

Closing after discussion on simplifying scope of the approach - SVG creation no longer needs to be optimized and reconstructed in Clarity.