Rather than trusting a web-server to send the HTML client-script, the client can access a far more trustless DOM-as-an-NFT “interface token” instead.
Interface tokens have the potential to drastically lower a client’s exposure to HTML attacks.
Interface tokens might cause the obsolescence of HTTPS; trustless interfaces could increase confidence in high-stakes DeFi products.
This is the simplest example of a “signature economy” interface token that is a just-shy-of fully onchain signature economy experience.
At time of writing, the block above is not being rendered by Mirror.xyz ‘s DOM so you’ll have to visit OpenSea to see this interface token in action.
At time of writing, here’s a snapshot of the fully rendered interface token.
To add your 0x-signature to this interface token, please mint an 0x-signature NFT here.
This is what an 0x-signature NFT looks like.
This is the fully onchain base64 HTML with the ABI array redacted for convenience.
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/web3@1.2.9/dist/web3.min.js">
</script>
</head>
<body>
<div id="signor"></div>
<script>
( function app() {
function html( $0 ) {
_0.doc.getElementById( 'signor' )
.innerHTML += '<p>' + $0 + '</p>'
;
}
function next( $0 ) {
if ( $0 == _0.zero ) {
_0.signor.forEach( _0.html )
; return
;
}
if ( $0 ) _0.signor.add( $0 )
_0.contract.methods.ownerOf(
_0.count
).call()
.then( ( $0 ) => {
_0.count ++
; _0.next( $0 )
;
} )
;
}
const _0 = new App
; _0.contract = new _0.web3.eth
.Contract( _0.abi, _0.address )
; _0.next()
;
function App() {
this.abi = [ ... ]
; this.address = '0xc6a81ff731dcb0f7'
+ '5bf6d8526fc660939a5f8241'
; this.contract = null
; this.count = 0
; this.doc = document
; this.html = html
; this.next = next
; this.signor = new Set
; this.web3 = new Web3(
new Web3.providers.HttpProvider(
'https://polygon-mainnet.g.a'
+ 'lchemy.com/v2/ud0m_4b'
+ '9PrCE3CWyXrPHRdy1NGBj'
+ 'SrD6'
)
)
; this.zero = '0x0000000000000000000'
+ '000000000000000000000'
;
}
} )()
</script>
</body>
</html>
Not entirely onchain, the script relies on a delivr.net NPM repository publisher request as well as an Alchemy.com node request.
Whenever this interface token’s script is rendered, the script looks up all the unique 0x owners in the collection and adds them to the interface token’s DOM.
Explained in the description about the ORAAND project below, this interface token is stored as two-layer base64 onchain metadata & content.
You can explore this interface token’s metadata & content yourself by visiting this query and inputting the number 3 to lookup its url.
More about signature economies at KERNEL.
WINDOWS93 is impressive Windows 9x emulating HTML first published late 2014.
The project shows how much a webapp can behave like an operating system as well as how much an operating system can be an interactive work of art.
ORAAND is a late 2022 Commodore 64 app as an NFT project.
ORAAN’s tokenURI
contains onchain ASCII-compatible data:application/json;base64
metadata.
Within that metadata, the animation_url
key points to an ASCII-compatible data:text/html;base64
value.
OpenSea displays this base64 HTML as an <iframe>
NFT.
As we develop interface token networks, Unix philosophy remains a very helpful guide.
According to Unix philosophy, text is the universal interface.
Unix philosophy emphasizes building simple, compact, clear, modular, and extensible code that can be easily maintained and repurposed by developers other than its creators.
Chunking packets of HTML within interface tokens might encourage the development of minimal-footprint kernels as an alternative to frameworks, such as the 117 line SeedTree kernel.
Each NFT in an NFT collection can be a ‘gist’ sized module as advocated for in Unix philosophy and necessary to be entirely onchain.
For instance, the ‘++’ collection that includes the “html sign” interface token example above also includes an NFT that can be used to localhost develop an interface token’s DOM experience.
A special index NFT can handle interface token version management. For instance, if this object.sol
generalized repo type is repurposed as the source-of-truth that points to the most recently minted version of any given interface token in the collection.
It’s becoming more and more common in web3 ecosystems for IPFS protocol hashes to be the URI for media. This helps combat link rot among other benefits.
Unlike HTTP, the IPFS protocol isn’t pointing to a particular address to retrieve media. Rather, IPFS relies on a hash to confirm whether what is retrieved -- from wherever it is actually retrieved -- is indeed what it is intended to be.
A hash URI “HURI” is important not as a source-of-truth but as a confirmation-of-truth.
Interface tokens benefit from this hash confirmation-of-truth, as the contract that defines them uses a HURI.
An NFT marketplace could spearhead browser integration of HURIs if the NFT marketplace completes IPFS src requests whenever rendering an interface token <iframe>
.