Skip to content

Use Base64VecU8 for tx_bytes in callbacks and storage#43

Draft
olga24912 wants to merge 1 commit into
tx64from
tx_bytes
Draft

Use Base64VecU8 for tx_bytes in callbacks and storage#43
olga24912 wants to merge 1 commit into
tx64from
tx_bytes

Conversation

@olga24912
Copy link
Copy Markdown

Summary

  • UTXO.tx_bytes and BTCPendingInfo.tx_bytes_with_sign switched from Vec<u8> to Base64VecU8 internally — compact base64 in JSON instead of arrays of numbers, saving gas on cross-contract callback args.
  • Legacy view methods preserve the old format via UTXOView / BTCPendingInfoView (return tx_bytes as a JSON byte array). Off-chain clients keep working without changes.
  • Added *_v2 view methods that return UTXO / BTCPendingInfo directly with base64 encoding.

State migration

Not required. Base64VecU8(pub Vec<u8>) is borsh-identical to Vec<u8>.

@olga24912 olga24912 requested a review from karim-en April 29, 2026 09:58
@karim-en karim-en marked this pull request as draft April 30, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant