Skip to content

Improve account onchain transaction labels. #397

@ffranr

Description

@ffranr

EDIT: Added changes following a call with Oli.

Executing account actions (create, renew, deposit, etc) involves generating transactions. Each transaction includes a label field which can store arbitrary data. Labels are limited to 500 characters in length.

Here are two example labels as they are currently used:

  poold -- AccountCreation(acct_key=028f4218ed13a50d9b6cc2afa947bba40e9336eaedbb10129ac1fda73a3d806252)
  poold -- AccountModification(acct_key=028f4218ed13a50d9b6cc2afa947bba40e9336eaedbb10129ac1fda73a3d806252, expiry=false, deposit=true, is_close=false)

Proposed Solution

Keep prefix tag, but drop the leading space: poold -- . Faraday looks for this tag.

Label structure:

{
  "account":{
    "action": "<action>",
    "key": "<string>",
    "expiry_height": <int>,
    "output_index": <int>,
    "expiry_spend": <bool>,
    "tx_fee": <int>,
    "balance_diff": <int>,
  }
}

The action field takes one of the following values:

  • create
  • deposit
  • withdraw
  • renew
  • close

key is the account key.

expiry_height is an integer block height at which the account expires. This value is important to ease the process of account recovery, see here.

output_index is an integer denoting the account balance transaction output.

expiry_spend is a boolean denoting whether the transaction spends via the expiry output path.

tx_fee is the onchain transaction fee for executing the account action.

balance_diff is a signed integer denoting the difference (+/-) in the account balance as a result of the transaction.

Here's a full minimized example (211 characters):

poold -- {"account":{"action":"withdraw","key":"028f4218ed13a50d9b6cc2afa947bba40e9336eaedbb10129ac1fda73a3d806252","expiry_height":2400,"output_index":1,"expiry_spend":false,"tx_fee":1027,"balance_diff":10000}}

@guggero @positiveblue @dstadulis Let me know if something might not workout or if anything can improved, and so on!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions