Skip to content

feat: migrate transaction envelope to Mainsail (RLP + ECDSA) - #82

Merged
ItsANameToo merged 8 commits into
feat/mainsailfrom
feat/add-abi-encode-decode
Jul 24, 2026
Merged

ItsANameToo merged 8 commits into
feat/mainsailfrom
feat/add-abi-encode-decode

Conversation

@shahin-hq

@shahin-hq shahin-hq commented Jul 22, 2026 •

Copy link
Copy Markdown

Summary

Closes: https://app.clickup.com/t/2570579/86e2fc2w4

  • Migrate transaction envelope to RLP (Mainsail/EVM-compatible) - replace the legacy Ark v2 binary format with [nonce, gasPrice, gasLimit, to, value, data, v, r, s] RLP encoding
  • Add hand-rolled RLP codec (rlp.go) - typed RlpBytes/RlpBigInt/RlpList encode/decode, no external dependency
  • Add ABI codec (abi.go, contracts.go) - function-call encode/decode for the 11 known Mainsail contract signatures
  • Replace Schnorr signing with recoverable ECDSA (secp256k1)
  • Rework network configuration - chainId-based Network
  • New Transaction struct - EVM-shaped fields (Nonce/GasPrice/GasLimit/To/Value/Data/V/R/S/...) replacing the old asset-based model
  • Rewrite serializer/deserializer around the RLP envelope + EIP-155 v encoding
  • Rewrite transaction signing/verification - Sign, RecoverSender, Verify, GetHash, SigningHash
  • Harden ABI/RLP decoders against malformed input - bounded integer conversions, list-length validation, no more silent truncation or panics on bad wire data
  • Trim dependencies - drop btcsuite/btcd and ellemouton/schnorr entirely; move to decred/dcrd/dcrec/secp256k1/v4 directly; upgrade golang.org/x/crypto, testify
  • Remove dead legacy-model code - enums.go, TransactionAsset/multisig types, and tests tied to the removed Schnorr/multisig builders
  • Add end-to-end round-trip tests - sign → serialize → deserialize → verify, plus negative/edge cases

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@shahin-hq shahin-hq changed the title feat: implement ABI encode/decode feat: migrate transaction envelope to Mainsail (RLP + ECDSA) Jul 23, 2026
@shahin-hq
shahin-hq marked this pull request as ready for review July 23, 2026 09:51
@shahin-hq
shahin-hq requested a review from alexbarnsley as a code owner July 23, 2026 09:51
@shahin-hq
shahin-hq requested review from ItsANameToo and goga-m July 23, 2026 09:54

@ItsANameToo ItsANameToo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add an implementation to https://github.com/ArdentHQ/sdk-tester-scripts to see it in action @shahin-hq ? that will make testing easier too

Comment thread crypto/fixtures/identity.json
Comment thread crypto/message.go Outdated
Comment thread crypto/abi.go Outdated
@shahin-hq

Copy link
Copy Markdown
Author

@ItsANameToo

can you add an implementation to https://github.com/ArdentHQ/sdk-tester-scripts to see it in action @shahin-hq ? that will make testing easier too

Would you mind if I do that after having this one merged, because I'll implement tx builders in the next PR which will enable us testing?

@ItsANameToo
ItsANameToo merged commit 4bd604b into feat/mainsail Jul 24, 2026
1 check passed
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.

2 participants