Skip to content

Latest commit

 

History

History
166 lines (118 loc) · 8.05 KB

registry.md

File metadata and controls

166 lines (118 loc) · 8.05 KB

Registry

Table of contents

Description

This registry defines all types used across COMIT RFCs. This registry may be expanded with new RFCs.

FRAME types

This section explains all possible FRAME types.

REQUEST / RESPONSE

Frames of type REQUEST have a type field. The following types are defined:

SWAP

Introduced in RFC-002.

A SWAP request and the according response allow for the following headers to appear:

  • alpha_ledger
  • beta_ledger
  • alpha_asset
  • beta_asset
  • protocol
  • decision

Please refer to RFC-002 for the exact definition of those headers.

Ledgers

The following is a list of possible values a Ledger type header can take:

Value Reference Description
bitcoin RFC-004 The Bitcoin Core family of blockchains
ethereum RFC-006 A blockchain following the Ethereum consensus rules

And the possible parameters they each may have:

bitcoin Parameters

Parameter Value Type Description
network see Bitcoin Networks The particular blockchain network to use

Bitcoin Networks

Value Description
regtest Private Bitcoin Core regtest network
testnet Bitcoin Core testnet
mainnet Bitcoin Core mainnet

ethereum Parameters

Parameter Value Type Description
network see Ethereum Networks The particular blockchain network to use

Ethereum Networks

Value Description
regtest Private Ethereum development network
ropsten Ropsten testnet
mainnet Ethereum mainnet

Assets

The following is a list of possible values an Asset type header can take:

Value Reference Description
bitcoin RFC-004 Native Bitcoin network asset
ether RFC-006 Native Ethereum network asset
erc20 RFC-008 ERC20 token
omni RFC-010 Omni Layer token

And the possible parameters they each may have:

bitcoin Parameters

Parameter Value Type Description
quantity u64 Quantity in satoshi

ether Parameters

Parameter Value Type Description
quantity u256 Quantity in wei

erc20 Parameters

Parameter Value Type Description
quantity u256 The ERC20 contract value to be transferred (not the decimal token quantity)
address 0x prefixed address The address of the ERC20 contract

omni Parameters

Parameter Value Type Description
quantity u64 The amount of Omni Layer assets to be transferred
property_id number The property id of the Omni Layer asset

SWAP Protocols

The following is a list of protocols defined in COMIT RFCs for use in the protocol header of a SWAP message (i.e. a REQUEST message with type SWAP).

Value Reference Description
comit-rfc-003 RFC-003 Basic HTLC Atomic Swap

SWAP decline reasons

The following is a list of response bodies that receivers of a SWAP REQUEST may choose to send back to the sender. The value of the decision header MUST be set to declined.

reason Reference Description
unsatisfactory-rate RFC-002 The rate of alpha_asset to beta_asset is not satisfactory to the receiver.
protocol-unsupported RFC-002 The protocol specified in the protocol header is not known to the receiving party.
unknown-ledger RFC-002 A ledger referenced by the sending party is unknown to the receiving party.
unknown-asset RFC-002 An asset referenced by the sending party is unknown to the receiving party.
timeouts-too-tight RFC-003 This indicates to the sender that the difference between alpha_expiry and beta_expiry is too small and the receiver may accept the swap if they are given more time.

Identities

RFC003 requires that each ledger has an associated identity:

Ledger Identity Name Encoding Reference Description
Bitcoin pubkey hex-encoded-bytes (33) RFC-004 A compressed public key
Ethereum address 0x prefixed address RFC-007 An Ethereum Address

Hash Functions

The following is a list of cryptographic hash functions for use within COMIT protocols:

Name Reference
SHA-256 IETF RFC463