Skip to main content

ACS7 - Contract CrossChain Standard

ACS7 is for implementing cross-chain contracts.

Interface

This involves methods for chain creation and indexing:

Methods

Method NameRequest TypeResponse TypeDescription
ProposeCrossChainIndexingacs7.CrossChainBlockDatagoogle.protobuf.EmptyPropose a cross-chain indexing.
ReleaseCrossChainIndexingProposalacs7.ReleaseCrossChainIndexingProposalInputgoogle.protobuf.EmptyRelease the proposed indexing if approved.
RequestSideChainCreationacs7.SideChainCreationRequestgoogle.protobuf.EmptyRequest side chain creation.
ReleaseSideChainCreationacs7.ReleaseSideChainCreationInputgoogle.protobuf.EmptyRelease the side chain creation request if approved.
CreateSideChainacs7.CreateSideChainInputgoogle.protobuf.Int32ValueCreate the side chain and return its ID. Only authorized users.
Rechargeacs7.RechargeInputgoogle.protobuf.EmptyRecharge a specified side chain.
DisposeSideChaingoogle.protobuf.Int32Valuegoogle.protobuf.Int32ValueDispose a side chain by ID. Only authorized users.
AdjustIndexingFeePriceacs7.AdjustIndexingFeeInputgoogle.protobuf.EmptyAdjust side chain indexing fee. Only authorized users.
VerifyTransactionacs7.VerifyTransactionInputgoogle.protobuf.BoolValueVerify a cross-chain transaction.
GetSideChainIdAndHeightgoogle.protobuf.Emptyacs7.ChainIdAndHeightDictGet all side chain IDs and heights.
GetSideChainIndexingInformationListgoogle.protobuf.Emptyacs7.SideChainIndexingInformationListGet indexing information of side chains.
GetAllChainsIdAndHeightgoogle.protobuf.Emptyacs7.ChainIdAndHeightDictGet IDs and heights of all chains.
GetIndexedSideChainBlockDataByHeightgoogle.protobuf.Int64Valueacs7.IndexedSideChainBlockDataGet block data of indexed side chain by height.
GetBoundParentChainHeightAndMerklePathByHeightgoogle.protobuf.Int64Valueacs7.CrossChainMerkleProofContextGet Merkle path bound to side chain by height.
GetChainInitializationDatagoogle.protobuf.Int32Valueacs7.ChainInitializationDataGet initialization data for a specified side chain.

Types

acs7.AdjustIndexingFeeInput

FieldDescriptionLabel
side_chain_id (int32)The side chain ID
indexing_fee (int64)The new indexing fee

acs7.ChainIdAndHeightDict

FieldDescriptionLabel
id_height_dict (map<int32, int64>)Chain IDs and heightsrepeated

acs7.ChainInitializationData

FieldDescriptionLabel
chain_id (int32)Side chain ID
creator (aelf.Address)Creator's address
creation_timestamp (google.protobuf.Timestamp)Creation timestamp
creation_height_on_parent_chain (int64)Height on parent chain
chain_creator_privilege_preserved (bool)If privilege is preserved
parent_chain_token_contract_address (aelf.Address)Token contract address
chain_initialization_consensus_info (ChainInitializationConsensusInfo)Initial consensus info
native_token_info_data (bytes)Native token info
resource_token_info (ResourceTokenInfo)Resource token info
chain_primary_token_info (ChainPrimaryTokenInfo)Primary token info

acs7.CreateSideChainInput

FieldDescriptionLabel
side_chain_creation_request (SideChainCreationRequest)Creation request info
proposer (aelf.Address)Proposer's address

acs7.CrossChainBlockData

FieldDescriptionLabel
side_chain_block_data_list (repeated SideChainBlockData)List of side chain block datarepeated
parent_chain_block_data_list (repeated ParentChainBlockData)List of parent chain block datarepeated

acs7.RechargeInput

FieldDescriptionLabel
chain_id (int32)Side chain ID
amount (int64)Amount to recharge

acs7.ReleaseCrossChainIndexingProposalInput

FieldDescriptionLabel
chain_id_list (repeated int32)List of chain IDs to releaserepeated

acs7.ReleaseSideChainCreationInput

FieldDescriptionLabel
proposal_id (aelf.Hash)Proposal ID

acs7.SideChainCreationRequest

FieldDescriptionLabel
indexing_price (int64)Cross-chain indexing price
locked_token_amount (int64)Initial locked balance
is_privilege_preserved (bool)If privilege is preserved
side_chain_token_creation_request (SideChainTokenCreationRequest)Token creation request
side_chain_token_initial_issue_list (repeated SideChainTokenInitialIssue)Initial token issues listrepeated
initial_resource_amount (repeated SideChainCreationRequest.InitialResourceAmountEntry)Initial resource amountsrepeated

Example

ACS7 defines methods for cross-chain scenarios. aelf provides an implementation for ACS7 called CrossChainContract. Refer to this implementation for more details.