You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NFT元数据能否设置多行描述?技术可行性咨询

能否为NFT的JSON元数据设置多行描述?

答案是肯定的,你可以通过在JSON字符串中添加转义换行符\n来实现多行描述,且Opensea、Rarible等主流NFT交易平台都能正常识别并展示换行效果。

具体实现方式

JSON规范允许字符串中使用\n作为转义换行符,因此你的元数据写法是完全合法的,示例代码如下:

{
    "title": "Asset Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents"
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents\nDescribes the asset to which this NFT represents\nDescribes the asset to which this NFT represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        }
    }
}

实际展示效果

在Opensea、Rarible等平台上,这段描述会被渲染成如下多行格式:

Describes the asset to which this NFT represents
Describes the asset to which this NFT represents
Describes the asset to which this NFT represents

补充说明

除了\n,部分平台也支持使用HTML的<br>标签来实现换行,但\n是纯文本转义方式,兼容性更广泛,不会因平台的HTML过滤规则导致失效,因此更推荐使用\n来实现多行描述。

内容的提问来源于stack exchange,提问作者Terry Windwalker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 15:30:53