什么是应用层协议(Application layer protocol)

请添加图片描述

更新日期:2022年1月21日 


​​​​​​​

应用层协议

介绍

比特币中的应用层协议是一个规则集,它可以由比特币交易内的任意数据来定义并存储。自从OP_RETURN可以压入的数据上限增加到100KB以来,应用开发者已经实现了各种用来存储网站、社交媒体帖子、图片、身份和其它类型数据的协议。

实例

随着输出数据记录输出(OP_RETURN)的大小扩展到了100KB,我们可以通过在比特币交易中创建一个False Return输出来存储各种类型的数据。

Bitcom协议是一种用于定义协议的提案。Bitcom提议将比特币地址存为前缀,以确保唯一性和命名空间。

由开发者_unwriter创建的B://协议经常被使用,它规定了如何将文件存储在链上,所使用的Bitcom构件同样来自于_unwriter。

例如,要存储一张鸭子的照片,我们使用协议前缀B://:

19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut

后面则是由B://定义的附加推送数据的不同字段:

[Image Buffer]

 image/png

 binary

 duck.png

此处是一个示例

交易大小不再设限

创建这种结构是为了与100KB数据承载上限相容,但在创世纪升级之后,我们可以在单个交易中写入更大的数据。此外,在脚本中适当地使用OP_PUSHDATA操作码,便可不再依赖OP_RETURN作为将数据添加至交易当中的唯一手段。

常用协议

  • Metanet协议 - 定义了一个有向图结构,其它应用可方便地查询和引用存储于比特币账本上的数据。
  • Tokenized协议 – 既是协议也是平台,发行人和用户可以利用内置的智能合约创建、管理和交易token。
  • Bitcom - 由输入地址进行唯一标识的应用协议去中心化注册表,可证明所有权。Bitcom协议可以用|字符进行串联。
  • B://C://D://BCAT - 这些是关于如何在账本上存储文件的协议,并详细介绍了如何在网页或应用中对文件进行引用。
  • AIP -(Author Identity Protocol - 这是一个可对任意OP_RETURN数据进行签名的简单协议,并可将签名地址与资金来源地址解耦。
  • MAP -(Magic Attribute Protocol - 通过链上的键/值对映射任意数据的协议。
  • HAIP -(Hash Author Identity Protocol  - 类似于AIP,但会对签名数据进行哈希,以适配小容量设备。
  • Memo SV – 该协议通过将Memo链上社交网络中的各种操作嵌入到OP_RETURN交易中来对这些操作加以定义。
  • 联系比特币协会,可帮您添加已发布的稳定协议。


Application layer protocol

Introduction

Application layer protocols in Bitcoin are rule sets defined and stored in transactions as arbitrary data. Various protocols have been implemented by application developers to store websites, social media posts, images, identity and other types of data since the OP_RETURN push data limit was increased to 100KB.

Practical example

With the data carrier size of an output expanded to 100KB, we can store various types of data by creating a False Return output in a Bitcoin transaction.

Bitcom is a proposal of a protocol, for defining protocols. Bitcom proposes to store a Bitcoin address as the prefix, ensuring uniqueness and a namespace.

A heavily used protocol is the B:// protocol created by developer _unwriter. This protocol defines how files can be stored on-chain, leveraging the Bitcom construct also defined by _unwriter.

For example, to store a photo of a duck, we use the protocol prefix for B:\\:

19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut

Followed by the different fields B:\\ defines as additional push data:

 [Image Buffer]

 image/png

 binary

 duck.png

Here is the example.

Unlimited transaction size

These constructs were created to work with a 100KB transaction size, but with the Genesis upgrade much larger data can be written in a single transaction. Additionally, the OP_PUSHDATA opcodes are able to be used properly in script eliminating the reliance on using OP_RETURN as the sole means of pushing data into transactions.

Widely used protocols

  • Metanet Protocol - Defines a directed graph structure that stores data on the Bitcoin ledger where it can easily be queried and referenced by other applications.
  • Tokenized Protocol - Defines protocol and platform where issuers and users can create, manage, and trade tokens leveraging built-in smart contracts.
  • Bitcom - Decentralised registry of application protocols uniquely identified by an input address, proving ownership. Bitcom protocols can be concatenated together with a | character.
  • B://C://D://BCAT - Various protocols for storing files on the ledger and details how to reference them in a web page or application.
  • AIP - Author Identity Protocol - Simple protocol to sign arbitrary OP_RETURN data and decouple the signing address from the funding source address.
  • MAP - Magic Attribute Protocol - Protocol that maps arbitrary data via key/value pairs on-chain.
  • HAIP - Hash Author Identity Protocol - Similar to AIP but hashes the data signed for smaller capacity devices.
  • Memo SV - Protocol that defines various actions on Memo's on-chain social network by embedding them in OP_RETURN transactions.
  • Contact the Bitcoin Association to have your stable, released protocol added.​​​​​​​

声明:

BSV知识库项目由BSV区块链发起并支持,更多信息请参见知识库官网:BSV Wiki


目前,全球已有超过400个项目构建于BSV区块链之上。凭借坚如磐石的协议及超高的网络性能,BSV生态系统迅猛发展,我们期待未来出现更多前所未有的商业应用。


  • 对BSV区块链开发感兴趣的朋友可以通过CSDN站内私信联系我们,申请加入BSV开发者交流群。
  • 同时,您也可以扫描下方二维码,关注BSV区块链官方微信公众号,了解更多区块链领域的实时资讯。

    Alt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值