Fee Delegation
Gas fees are usually paid by the address that signs the transaction. VeChain's fee delegation allows you to pass on this payment to another wallet, which can either reside as private key in your realm or shielded by a web service.
To use fee delegation, you can need to:
Enable it while building the transaction object
Provide information about the delegator during transaction signing
Enable Fee Delegation
To enable fee delegation as feature, you need to set isDelegated
to true
while building the transaction body:
Sign with Fee Delegation
To get the fee delegator involved, you'll pass either delegatorPrivateKey
or delegatorUrl
to the signing wallet:
Example Project
Sign as Delegator Service
To shield your private key for paying gas fees into a backend service, you can setup a web-service that receives a raw transaction and co-signs it to confirm gas payment (based on VIP-201).
The process requires you to rebuilt a transaction object from a hex encoded version:
Afterwards a unique hash is calculated for the given transaction, only valid if a specific origin will sign it:
The resulting hash is signed and then returned as hex string for further processing on the client side:
Example Project
Last updated