API Reference

When to use SDK

Through BlockATM-Guard(An open-source desktop client tool), you can securely make payout with encrypted assets because it operates entirely on the local machine. However, its emphasis on security sacrifices some convenience, such as the inability to assist customers with automatic cryptocurrency payout. Since BlockATM is a self-hosted application, it means that BlockATM cannot transfer any of the customer's on-chain assets. Therefore, we provide a Auto-payout SDK that allows you to easily integrate automatic payout functionality while ensuring that neither any third party nor BlockATM has control over your on-chain assets.

If you want to have real-time transfer of assets in your payout contract, such as being able to respond immediately when your customers initiate cryptocurrency transfers and make payment through your payout smart contract, then integrating the automatic payment SDK is your best choice.

Technical principle

Permit trigger address

As mentioned earlier regarding security, the assets in your payout smart contract cannot be transferred without the signature of your financial personnel. Therefore, we first need an additional trigger address that has partial signing authority for payout transactions. This address can only be specified by your financial personnel through gateway contract., and you can remove it at any time through on-chain contract interactions in BlockATM.

note:

  • Only financial can permit the trigger address.
  • The trigger address can only be used for payout through the controller contract.
  • Delete the trigger address at any time to prevent asset loss when triggering risk controls.

Private-key management

Once you have completed the authorization process for the trigger address, it means that the trigger address has the authority to transfer assets in the payout contract. Therefore, its private key should not be stored in plain text on yout server. We recommend using a private key management solution that allows for signing operations without exposing the plaintext private key, such as AWS CloudHSM( Cloud Hardware Security Module) or KMS( Key Management Service) . You can refer to their documentation for instructions on how to use them.

Certainly, you can also implement encryption for secure storage of private keys using cryptographic algorithms. As long as the private key remains protected and not exposed, it can be considered secure.

Send transaction to the blockchain

Correct, using an SDK allows for easier interaction with the blockchain. All interactions with the contract are encapsulated through the SDK. Even if you are not familiar with web3 develop, using SDK can help you quickly get started with development.

Obtain transaction result

When a payout transaction is executed, you can obtain the execution result in two ways:

  • Querying the transaction details on-chain using the methods provided by the SDK.
  • BlockATM will notify you of the transaction result through a webhook callback.

Workflow

The complete process of auto payout: