Bitcoin: authorize CoinJoin

Allow device to do preauthorized operations in signTransaction and getOwnershipProof methods without further user interaction.

Permission persists until physical device disconnection or maxRounds limit is reached.

const result = await TrezorConnect.authorizeCoinJoin(params);

:warning: This feature is experimental! Do not use it in production!

:note: Supported only by Trezor T with Firmware 2.5.3 or higher!

Params

Optional common params

Exporting single id

  • pathrequired string | Array<number>

    prefix of the BIP-32 path leading to the account (m / purpose' / coin_type' / account')read more

  • coordinatorrequired string

    coordinator identifier to approve as a prefix in commitment data (max. 36 ASCII characters)

  • maxRoundsrequired number

    maximum number of rounds that Trezor is authorized to take part in

  • maxCoordinatorFeeRaterequired number

    maximum coordination fee rate in units of 10**6 percent

  • maxFeePerKvbyterequired number

    maximum mining fee rate in units of satoshis per 1000 vbytes

  • coin - optional string

    Determines network definition specified in coins.json file. Coin shortcut, name or label can be used.

  • scriptTypeoptional PROTO.InputScriptType

    used to distinguish between various address formats (non-segwit, segwit, etc.)

  • amountUnitoptional PROTO.AmountUnit

    show amounts in

  • preauthorizedoptional

    Check if device session is already preauthorized and take no further action if so

  • coinjoinRequestoptional PROTO.CoinJoinRequest

    Signing request for a CoinJoin transaction

Example:

TrezorConnect.authorizeCoinJoin({
    path: "m/10086'/0'/0'",
    maxRounds: 3,
    maxCoordinatorFeeRate: 500000, // 0.5% => 0.005 * 10**8;
    maxFeePerKvbyte: 3500,
    scriptType: 'SPENDWITNESS',
});

Result

Success type

{
    success: true,
    payload: {
        message: 'CoinJoin authorized'
    }
}

Error

{
    success: false,
    payload: {
        error: string // error message
    }
}