Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radiant RXD Native UTXO protocol #828

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Ektisad25
Copy link

No description provided.

@cipig
Copy link
Member

cipig commented Sep 22, 2023

RXD uses a different tx signing algo and doesn't work without changes to https://github.com/KomodoPlatform/komodo-defi-framework code

i tried with this settings some time ago

  {
    "coin": "RXD",
    "name": "radiant",
    "fname": "Radiant",
    "rpcport": 7332,
    "pubtype": 0,
    "p2shtype": 5,
    "wiftype": 128,
    "segwit": false,
    "fork_id": "0x40",
    "signature_version": "witness_v0",
    "txfee": 1000000,
    "force_min_relay_fee": true,
    "mm2": 1,
    "sign_message_prefix": "Bitcoin Signed Message:\n",
    "required_confirmations": 2,
    "avg_blocktime": 300,
    "protocol": {
      "type": "UTXO"
    },
    "derivation_path": "m/44'/512'",
    "links": {
      "github": "https://github.com/RadiantBlockchain/radiant-node",
      "homepage": "https://radiantblockchain.org"
    }
  },

the important setting in this case is "signature_version": "witness_v0"

the error on sending tx with witness_v0 is

  {"error":"rpc:211] dispatcher_legacy:141] lp_coins:3721] utxo_common:2558] rpc_clients:2235] JsonRpcError { client_info: \"coin: RXD\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"13\", method: \"blockchain.transaction.broadcast\", params: [String(\"0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c60100000000ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588ac7f060e65\")] }, error: Response(electrumx.radiant4people.com:50010, Object({\"code\": Number(1), \"message\": String(\"the transaction was rejected by network rules.\\n\\nmandatory-script-verify-flag-failed (Operation not valid with the current stack size) (code 16)\\n[0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c60100000000ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588ac7f060e65]\")})) }"}

mandatory-script-verify-flag-failed (Operation not valid with the current stack size) (code 16)

with "signature_version": "base" it's this error

{"error":"rpc:211] dispatcher_legacy:141] lp_coins:3721] utxo_common:2558] rpc_clients:2235] JsonRpcError { client_info: \"coin: RXD\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"7\", method: \"blockchain.transaction.broadcast\", params: [String(\"0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c6010000006b483045022100ae9f100837baf0409a264cb31f18d2f88212f78c3a0229955bdbec21f2bd8819022027049b1a4a618bed0ee9cbaf52fa2e1cd25e8b0717251ca9ae5fe0802376199d412103de96cb66dcfaceaa8b3d4993ce8914cd5fe84e3fd53cefdae45add8032792a12ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588ac9a0b0e65\")] }, error: Response(electrumx.radiant4people.com:50010, Object({\"code\": Number(1), \"message\": String(\"the transaction was rejected by network rules.\\n\\nmandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)\\n[0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c6010000006b483045022100ae9f100837baf0409a264cb31f18d2f88212f78c3a0229955bdbec21f2bd8819022027049b1a4a618bed0ee9cbaf52fa2e1cd25e8b0717251ca9ae5fe0802376199d412103de96cb66dcfaceaa8b3d4993ce8914cd5fe84e3fd53cefdae45add8032792a12ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588ac9a0b0e65]\")})) }"}

mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)

the other possible settings for signature_version, fork_id does not work either and not setting signature_version at all shows this error

{"error":"rpc:211] dispatcher_legacy:141] lp_coins:3721] utxo_common:2558] rpc_clients:2235] JsonRpcError { client_info: \"coin: RXD\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"7\", method: \"blockchain.transaction.broadcast\", params: [String(\"0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c6010000006a473044022025f5624f9c3818dd79901182076aea52fd5b739ed074f4f63679160e3b15381f022042ec35f269a6e56eaa8c8d74d6c8c4451b1531388488386d808c32dffd76b3dd412103de96cb66dcfaceaa8b3d4993ce8914cd5fe84e3fd53cefdae45add8032792a12ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588acda0c0e65\")] }, error: Response(electrumx.radiant4people.com:50010, Object({\"code\": Number(1), \"message\": String(\"the transaction was rejected by network rules.\\n\\nmandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)\\n[0100000001c25c979326b0ec802a645cc27e39a8e25fce5de0f40a23e402084e719ec1a1c6010000006a473044022025f5624f9c3818dd79901182076aea52fd5b739ed074f4f63679160e3b15381f022042ec35f269a6e56eaa8c8d74d6c8c4451b1531388488386d808c32dffd76b3dd412103de96cb66dcfaceaa8b3d4993ce8914cd5fe84e3fd53cefdae45add8032792a12ffffffff0200ca9a3b000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac6d7fefe1080000001976a9146aafbb75331085425727a78a940e9334f681b3e588acda0c0e65]\")})) }"}

so i assume RXD needs a totally different one implemented

@Ektisad25
Copy link
Author

we open issue ,it contain code source of RXD
KomodoPlatform/komodo-defi-framework#1974

@Ektisad25
Copy link
Author

It needs FORKID and hashOutputHashes in the sighash preimage
https://github.com/RadiantBlockchain/electrumx/blob/master/electrumx/lib/tx.py#L188

@cipig
Copy link
Member

cipig commented Sep 24, 2023

It needs FORKID and hashOutputHashes in the sighash preimage https://github.com/RadiantBlockchain/electrumx/blob/master/electrumx/lib/tx.py#L188

"fork_id": "0x40" is set, see my settings i posted
but if there is a change to tx signing algo which is neither default nor one of the 3 others (base, witness_v0 or fork_id) supported by API, then it needs to be added as a 4th option to the code

@smk762
Copy link
Collaborator

smk762 commented Oct 11, 2023

Set as draft until API changes completed and merged into a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants