EScription
  • EScription
    • Deploy
    • Mint
    • Transfer
  • ESC-20
    • Deploy
    • Mint
    • Transfer
    • List
    • Transaction process
    • Index Rules
  • ESIPS
    • What are ESIPs?
    • Accepted ESIPs
  • Marketplace
    • Verified Badge
  • Developer Service
    • Legal Disclaimer
  • CrossContract
    • IBRC20Deploy
    • IValidator
    • ICrossInscribe
  • Cross Chain Validator
    • How to install validator?
    • How to run?
Powered by GitBook
On this page
  • 一. The Owner‘s Method
  • setValidatorAgreeCount(uint256 agreeCount)
  • setBridgeCosts(uint256 newFee)
  • getBridgeCosts()
  • changeBindAddressFee(uint256 newFee)
  • getBindAddressFee()
  • setValidatorContract(address account)
  • getValidatorContract()
  • refundFee(address payable toUser, uint256 amount)
  • refundInscrition(address toUser, string memory tick, uint256 amount)
  • 二. User‘s Method
  • bindAddress(string memory btcAddress, bytes memory btcSignature)
  • 三.Validator's Method
  • bindAddressResponse(address user, uint256 nonce)
  • getBoundBtcAddress(address evmAddress)
  • getBoundEVMAddress(string memory btcAddress)
  • bridgeToBTCResponse(address fromUser, uint256 nonce)
  • bridgeToBTCConfirm(address fromUser, uint256 nonce, bytes32 txID)
  • confirmBridgeBtcToEth(string memory txid, string memory inscriptonID, string memory inscription, string memory tick, uint256 amount, address toAddress)
  1. CrossContract

ICrossInscribe

The ICrossInscribe interface defines a set of operations related to cross-chain signing and address binding.

一. The Owner‘s Method

setValidatorAgreeCount(uint256 agreeCount)

Purpose: Sets the validator agreement count.

Parameter: Agree count (uint256).

setBridgeCosts(uint256 newFee)

Purpose: Sets the new bridge cost.

Parameter: New bridge cost (uint256).

getBridgeCosts()

Purpose: Retrieves the current bridge cost.

changeBindAddressFee(uint256 newFee)

Purpose: Changes the binding address fee.

Parameter: New binding address fee (uint256).

getBindAddressFee()

Purpose: Retrieves the current binding address fee.

setValidatorContract(address account)

Purpose: Sets the validator contract address.

Parameter: Validator contract address (address).

getValidatorContract()

Purpose: Retrieves the current validator contract address.

refundFee(address payable toUser, uint256 amount)

Refunds a fee to a user.

refundInscrition(address toUser, string memory tick, uint256 amount)

Purpose: Refunds an inscription to a user

二. User‘s Method

bindAddress(string memory btcAddress, bytes memory btcSignature)

Purpose: Binds a BTC address to an EVM address, requires a fee. Need User to Sign a btc address and

EVM address.

btcSignature need 65 byte, and add v at the signature front。

let v = sig.recid
if (v < 27) {
    v += 27;
}
let signature = new Uint8Array(65)
signature[0] = v;
for(let i =0; i < sig.signature.length; i++) {
    signature[i+1] = sig.signature[i];
}

三.Validator's Method

bindAddressResponse(address user, uint256 nonce)

Purpose: Handles response for binding a BTC address.

The validator verifies the user's signature and submits the result。

getBoundBtcAddress(address evmAddress)

Purpose: Retrieves the bound BTC address for a given EVM address.

getBoundEVMAddress(string memory btcAddress)

Purpose: Retrieves the bound EVM address for a given BTC address.

bridgeToBTCResponse(address fromUser, uint256 nonce)

Purpose: Validator handles response for a cross-chain transaction to BTC.

bridgeToBTCConfirm(address fromUser, uint256 nonce, bytes32 txID)

Purpose: Confirms a cross-chain transaction to BTC

confirmBridgeBtcToEth(string memory txid, string memory inscriptonID, string memory inscription, string memory tick, uint256 amount, address toAddress)

Purpose: Confirms a cross-chain transaction from BTC to ESC

.

PreviousIValidatorNextCross Chain Validator

Last updated 1 year ago