Procedure for Method 1

  1. Inscribe Each Index Array Independently: Each index array is inscribed on the blockchain with an empty content field. The specific index array is encoded in the metadata field of the inscription. This step is essential for maintaining a flexible and upgradable trait system.

  2. Inscribe Display.html: This HTML file is used to display the final NFT and should be inscribed on the blockchain.

Example Display.html Code

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Moggy</title>
</head>
<script type="module">
	import { getMetadata, getSatAt, getBlockHash } from '/content/ef7689dc2f504f63f8d13356f8928a2fec097b3b014c9fe53a1d1ddb5952f5dbi0'

	let inscriptionId = window.location.pathname.split("/")[2];

	window.onload = async function() {
		let moduleLib = await getSatAt("1007647032624282", "-1")
		let imp = '/content/' + moduleLib.id;
		let metadata = await getMetadata(inscriptionId)
		import(imp).then(compiler => {
			return compiler.getSvg(metadata);
		}).then(svg => {
			document.body.appendChild(svg);	
		});
	}
</script>
<body>
</body>
</html>
  1. Inscribe the Final NFT: This step involves creating the final inscription that the users will actually own. This inscription leverages the delegation field, pointing to the inscription ID of the previously inscribed display.html (step 2). Additionally, it includes the satpoint from the index array inscription (step 1) encoded in the metadata field. This mechanism ensures that the final NFT reflects the traits specified in the index array while maintaining a clear link to the visual representation managed by display.html.

Last updated