Skip to content

Latest commit

 

History

History
362 lines (271 loc) · 9.75 KB

aip-103.md

File metadata and controls

362 lines (271 loc) · 9.75 KB
  AIP: *103*
  Title: *Marketplace Transaction Types*
  Authors: *ARK.io Team *
  Status: *Draft | Active*
  Discussions-To: https://github.com/arkecosystem/AIPS/issues/103
  Type: *Standards*
  Category: Core | Network | Protocol
  Created: 2019-06-27
  Last Update: 2019-08-31
  Requires: AIP-29
tags: AIP specs

Magistrate Transaction Types

A team or a company will be able to issue a business/bridgechain registration transaction in the same way a delegate registration transaction is issued. The proposed fee for this transaction should be in the level of delegate registration ARK as it relates to a similar process, however as this introduces more data being stored on mainnet, we should take spam protection into consideration (fees, rules). We will also add ability to terminate business or bridgechain via a special transaction type (reason: for new projects or companies to use the non-claimed chain ticker, business name).

Prerequisites:

AIP-29.

General Features:

Hardware limitations

Size limitations related to size of specifics fields, that can go into the additional assets. We must be careful and limit every incoming field to avoid simple and cheap attack issues on the mainnet - which would result in size/spam increase.

Processing Limits

  1. Strict schema validation
  2. Ensure checks on transaction pool and protocol level (see specs for each transaction type)

Check below for specification of new transaction types. We are introducing the following transaction types:

  1. BusinessRegistration
  2. BusinessResignation
  3. BusinessUpdate
  4. BridgeChainRegistration
  5. BridgeChainResignation
  6. BridgechainUpdate

1.BusinessRegistration Transaction

Name: BusinessRegistration

A issuer can register its own business.

Fields:

Field Size(bytes) Requires
name 40 Y
website 50 Y
vat 15 N
repository 50 N

Schema interface

export const businessSchema = {
    name: {
        $ref: "genericName",
    },
    website: {
        $ref: "uri",
    },
    vat: {
        type: "string",
        minLength: 8,
        maxLength: 15,
        $ref: "alphanumeric",
    },
    repository: {
        $ref: "uri",
    },
};

Asset interface definition

export interface IBusinessRegistrationAsset {
    name: string;
    website: string;
    vat?: string;
    repository?: string;
}

Transaction Processing:

Add BusinessInformation to wallets, so we can identify them and access the latest data.

Verify

  • All normal rules from GTI handlers (signature, serde process, pool security,...)
  • Size limitations of specific fields
  • Schema validation of some fields

Apply

  • add state to wallet (Business)

CannotBeApplied

  • If business is already registered
  • If business is resigned

Fees

  • We MUST enforce a high static fee ~ 50 ARK

2. BusinessResignation Transaction

Name: BusinessResignation

A Business can terminate its registration, if it’s no longer operational or working.

Transaction Processing:

Verify

  • All normal rules from GTI handlers (signature, serde process, pool security,...)
  • Only a registered business can issue this transaction type.

Apply

  • Add state to wallet (resigned)
  • All bridgechains are resigned

CannotBeApplied

  • If wallet doesn't have business state
  • If business has been already resigned

Fees

  • Normal transfer fee

3. BusinessUpdate Transaction

A Business can update its business asset stored in wallet.

Fields:

Field Size(bytes) Requires
name 40 N
website 50 N
vat 15 N
repository 50 N

Asset interface definition

export interface IBusinessUpdateAsset {
    name?: string;
    website?: string;
    vat?: string;
    repository?: string;
}

Transaction Processing:

Verify

  • All normal rules from GTI handlers (signature, serde process, pool security,...)
  • Only a registered business can issue this transaction type.

Apply

  • Allowed fields are updated during the apply logic

CannotBeApplied

  • If business doesn't have business state
  • If business has been resigned

Fees

  • We enforce static fee of 50 ARK

4. BridgeChainRegistration Transaction

Name: BridgeChainRegistration

Only a registered business can issue a bridgechain registration transaction.

Fields:

Field Size(bytes) Requires
name 40 Y
seedNodes 400 Y
genesisHash 33 Y
bridgechainRepository 50 Y
bridgechainAssetRepository 90 N
ports 4 Y

Asset interface definition

export interface IBridgechainRegistrationAsset {
    name: string;
    seedNodes: string[];
    genesisHash: string;
    bridgechainRepository: string;
    bridgechainAssetRepository?: string;
    ports: IBridgechainPorts;
}

Wallet interface definition

export interface IBridgechainWalletAttributes {
    bridgechainAsset: Interfaces.IBridgechainRegistrationAsset;
    resigned?: boolean;
}

Schema interface

properties: {
    name: {
        $ref: "genericName",
    },
    seedNodes: {
            type: "array",
            minItems: 1,
            maxItems: 10,
            uniqueItems: true,
            items: {
                type: "string",
                format: "peer",
            },
        },
    genesisHash: {
        $ref: "transactionId",
    },
    bridgechainRepository: {
        $ref: "uri",
    },
    bridgechainAssetRepository: {
        $ref: "uri",
    },
    ports:{
        type: "object",
        maxProperties: 1,
        minProperties: 1,
        required: ["@arkecosystem/core-api"],
        additionalProperties: false,
        properties: {
            "@arkecosystem/core-api": {
                type: "integer",
                minimum: 0,
                maximum: 65535,
            },
        },
    }
};

Transaction Processing:

Verify

  • All normal rules from GTI handlers (signature, serde process, pool security,...)
  • Only a registered business can issue this transaction type. If address has not issued a BusinessTransaction yet, it should be rejected.
  • Size limitations of specific fields
  • Max number of input seeds (~10)

Apply

  • Add bridgechain details to BusinessRegistered wallets (core-state), so we can list them and access the latest data specified data
  • Bridgechain nonce introduction - we apply a bridgechain nonce to every registered bridgechain. The bridgechain nonce will at a later point be used as a chainId to enable cross-chain operations.

CannotBeApplied

  • If wallet doesn't have business state
  • If wallet has resigned as a business

Fees

  • We MUST enforce a high static fee ~ 50 ARK
  • Expand the protocol, so that only static fee is accepted

5. BridgeChainResignation Transaction

A Business can terminate one of its bridgechain registrations. The bridgechain nonce (or also called bridgechain id) needs to be provided for the exact bridgechain that is resigning.

Name: BridgeChainResignation

Fields:

Field Size(bytes) Requires
bridgechainId 8 Y
export interface IBridgechainResignationAsset {
    bridgechainId: string;
}

Transaction Processing:

Verify

  • All normal rules from GTI handlers (signature, serde process, pool security,...)
  • Only a registered business can issue this transaction type
  • We need to define the ID of bridgechain we are resigning

Apply

  • Add resigned flag to wallet

CannotBeApplied

  • If specified bridgechain is already resigned
  • If wallet is not a business
  • If wallet has resigned as a business

Fees

  • Normal dynamic transfer fee

6. BridgeChainUpdate Transaction

A Business can update bridgechain registrations (if it is the same owning wallet). During the update process we can only update/add additional seedNodes to the process.

Fields

Field Size(bytes) Requires
bridgechainId 8 Y
seedNodes array[] N
ports 4 N
bridgechainRepository 80 N
bridgechainAssetRepository 80 N

Asset interface definition

export interface IBridgechainUpdateAsset {
    bridgechainId: string;
    seedNodes?: string[];
    ports?: IBridgechainPorts;
    bridgechainRepository?: string;
    bridgechainAssetRepository?: string;
}

Verify

  • Schema validation

Apply

  • Fields are updated during the apply logic

CannotBeApplied

  • If specified birdgechain is already resigned
  • If wallet is not a business
  • If wallet has resigned as a business

Fees

  • We MUST enforce a high static fee ~ 50 ARK

Final decision and specifics will be adjusted by project lead and aligned during actual implementation.

Implementation

Implementation can be found here: ArkEcosystem/core#2858