PlayTrain
2023–24 · Toshi · Ethereum mainnet, ENS (NameWrapper)
0x77b01feb029aba23fd3fcfd448b942fdbd437464
I’ve tried thinking in terms of lines, not planes.
The birth of NFTs has resulted in a variety of collections being born and visualized online. Within this context, decentralization is envisioned, and individual entities that exist as points become planes through NFTs.
This time, I used the ENS, a symbol of individual identity in the realm of NFTs, to conceptualize a single collection as a line.
Please take a ride on the train headed by tsh.eth.
How to get on the train
New rides are currently suspended.
Check boarding status
OpenSea
Technical Note
In this project, we utilize the ENS (Ethereum Name Service) and its NameWrapper on the Ethereum Mainnet. ENS makes ETH wallet addresses more human-readable. It also allows for the association of diverse records, enabling you to express your own identity.
Furthermore, in ENS, there is something called a “Subname” which corresponds to the concept of a subdomain in a URL. In this project, we are playing “train” by layering these Subnames.
Subnames are generated only from nodes already existing on the NameWrapper, and when they are distributed as NFTs, they are sent to the holder of that node. Therefore, participants need to wrap their own ENS in advance.

Contract
The source verified on Etherscan.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "./INameWrapper.sol";
import "./ENS.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "https://github.com/ensdomains/name-wrapper/blob/master/contracts/BytesUtil.sol";
contract PlayTrain is Ownable, ERC1155Holder {
using BytesUtils for bytes;
INameWrapper nameWrapper;
uint256 public index;
address public resolver;
bool public isMintable;
mapping(bytes32 => bool) public isMinted;
mapping(uint256 => bytes32) public indexToNode;
mapping(uint256 => address) public indexToOwner;
function setEnsData(address _nameWrapper, address _resolver, bytes32 _startNode) external onlyOwner {
nameWrapper = INameWrapper(_nameWrapper);
resolver = _resolver;
indexToNode[0] = _startNode;
}
function getOnTheTrain(bytes32 yourNode, string memory label) public {
require(isMintable, "PlayTrain: not mintable");
require(!isMinted[yourNode], "PlayTrain: Already minted");
bytes memory name = nameWrapper.names(yourNode);
(bytes32 labelhash, ) = name.readLabel(0);
require(labelhash == keccak256(bytes(label)), "PlayTrain: label is not correct");
nameWrapper.setSubnodeRecord(
indexToNode[index],
label,
address(this),
resolver,
0,
0,
0
);
bytes32 nextParentNode = _makeNode(indexToNode[index], labelhash);
(address owner, ,) = nameWrapper.getData(uint256(yourNode));
uint256 nextIndex = ++index;
indexToOwner[nextIndex] = owner;
indexToNode[nextIndex] = nextParentNode;
isMinted[yourNode] = true;
if(index > 2){
uint256 tokenid = uint256(indexToNode[index - 2]);
nameWrapper.safeTransferFrom(address(this), indexToOwner[index - 2], tokenid, 1, "");
}
}
function setMintable(bool _isMintable) external onlyOwner {
isMintable = _isMintable;
}
function _makeNode(bytes32 node, bytes32 labelhash) private pure returns (bytes32) {
return keccak256(abi.encodePacked(node, labelhash));
}
function getIndex() external view returns(uint256) {
return index;
}
function getNode(uint256 _index) external view returns(bytes32) {
return indexToNode[_index];
}
function transfer(address from, address to, uint256 id) external onlyOwner {
nameWrapper.safeTransferFrom(from, to, id, 1, "");
}
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes memory data
) public override(ERC1155Holder) returns(bytes4) {
return ERC1155Holder.onERC1155Received(operator, from, id, value, data);
}
}
Read / Write
PlayTrain0x77b01FeB029abA23FD3FCfD448B942FDBd437464
Exhibitions
Proof of X - Blockchain As A New Medium For ArtTHE FACE DAIKANYAMA, Tokyo2023-06-17 – 2023-06-25