Skip to main content
Version: 1.3.0

Signer

The signer is used to perform offline signatures for multiple withdrawal transactions, accelerating the process of publishing transactions to the blockchain.

Installing the Signer

1. Get the Signer Code

Pull the signer files from Github.

Github repository address: https://github.com/PayProtocol-Network/SignTool.git

2. Build the Docker Image

Navigate to the project directory and run the following command to build a Docker image named signer:1.0:

docker build -t signer:1.0 .

3. Download the ENV Configuration File

Log in to the backend to download the corresponding .env file. For the sandbox environment, visit https://adm-sandbox.payprotocol.network, locate the page shown in the image, and click Download ENV File to obtain a test.env file.

(Note: If it is a production environment, please visit https://adm.payprotocol.network to download the prod.env file.)

Download ENV File

4. Configure Environment Variables

Open the test.env file downloaded in Step 3 and write the private keys of the owner wallet address and merchant parameters into the signer environment file (using the sandbox environment test.env as an example).

The private key will only be used internally within the signer to sign transactions and will never be exposed outside the signer.

Use a text editor to open the environment file. Fill in all parameters correctly:

SPRING_PROFILES_ACTIVE=test

MER_API_KEY=商户 API Key
MER_API_SECRET=商户 Secret Key

EVM_PRIVATE_KEY={"139":"EVM(Ethereum) owner wallet address private key"}
TVM_PRIVATE_KEY={"136":"TVM(Tron) owner wallet address private key"}

# No need to modify the following parameters
EVM_BATCH_TRANSFER={}
EVM_MULTI_SIG_COLD={}
EVM_COLD_POOL_ADDR={}
EVM_TOOL_HELPER_ADDR={}
EVM_MER_ACCOUNT_ADDR={}
EVM_FACTORY_ADDR={}

TVM_BATCH_TRANSFER={}
TVM_MULTI_SIG_COLD={}
TVM_COLD_POOL_ADDR={}
TVM_TOOL_HELPER_ADDR={}
TVM_MER_ACCOUNT_ADDR={}
TVM_FACTORY_ADDR={}

TEST_TX_PARAM_URL=https://api-sandbox.payprotocol.network/api/mer/withdraw/transactionDetail
TEST_CURRENCY_URL=https://api-sandbox.payprotocol.network/api/mer/conf/list/currency
TEST_ESTIMATION_URL=https://api-sandbox.payprotocol.network/api/mer/transaction/estimate
TEST_WITHDRAWAL_URL=https://api-sandbox.payprotocol.network/api/mer/withdraw/submit
TEST_REBALANCE_URL=https://api-sandbox.payprotocol.network/api/mer/balance/submit
TEST_SUBMIT_AGGREGATEURL=https://api-sandbox.payprotocol.network/api/mer/summary/submit
TEST_AGGREGATE_URL=https://api-sandbox.payprotocol.network/api/mer/summary/list
TEST_BALANCES_URL=https://api-sandbox.payprotocol.network/api/mer/transaction/balances

TX_PARAM_URL=https://api.payprotocol.network/api/mer/withdraw/transactionDetail
CURRENCY_URL=https://api.payprotocol.network/api/mer/conf/list/currency
ESTIMATION_URL=https://api.payprotocol.network/api/mer/transaction/estimate
WITHDRAWAL_URL=https://api.payprotocol.network/api/mer/withdraw/submit
REBALANCE_URL=https://api.payprotocol.network/api/mer/balance/submit
SUBMIT_AGGREGATEURL=https://api.payprotocol.network/api/mer/summary/submit
AGGREGATE_URL=https://api.payprotocol.network/api/mer/summary/list
BALANCES_URL=https://api.payprotocol.network/api/mer/transaction/balances

Please ensure that the owner wallet address has TRX / ETH on the "TRON" / "ETH" chain, as it needs to sign the transaction and pay a certain network fee after the transaction is published.

5. Run the Docker Container

Save the above files in the project directory downloaded from git. Run the following command to start the signer: (The external port 8080 can be adjusted as needed)

$ docker run --env-file ./signer.env -p 8080:9980 -d --name signer signer:1.0

The signer is now running and listening. We can use the following command to verify that it is running:

$ docker ps

The output should contain an entry with the name of the image we just ran, as shown below:

CONTAINER ID  IMAGE       COMMAND                 CREATED       STATUS       PORTS                                       NAMES
dcd43bbe138a signer:1.0 "java -jar /home/jav…" 4 seconds ago Up 3 seconds 0.0.0.0:8080->9980/tcp, :::8080->9980/tcp signer

Sign Withdrawal Transactions through the Signer

  1. Obtain the list of withdrawal orders to be processed. Please refer to the merchant API interface Query Withdrawal Order List.
  2. Submit the list of withdrawal orders to the relevant interface of the signer (Signer API Documentation), and the signer will return the signature results.

Sign Rebalance Transactions through the Signer

  1. Obtain the current address balance for the currency. Please refer to the merchant API interface Query Currency Balance.
  2. Determine if rebalancing is needed based on the currency balance. If rebalancing is required, please call the relevant interface of the signer (Signer API Documentation), and the signer will return the signature results.

Sign Aggregation Transactions through the Signer