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

P2PK input cause taker fee validation to fail #2339

Open
Alrighttt opened this issue Feb 5, 2025 · 0 comments
Open

P2PK input cause taker fee validation to fail #2339

Alrighttt opened this issue Feb 5, 2025 · 0 comments
Labels
bug: swap priority: urgent Critical tasks requiring immediate action.

Comments

@Alrighttt
Copy link
Member

Using a P2PK("pay to public key" or <pubkey> OP_CHECKSIG input for sending taker fee will result in maker validation of the taker fee to fail with the following error.

{
    "timestamp": 1738765718666,
    "event": {
        "type": "TakerFeeValidateFailed",
        "data": {
            "error": "maker_swap:777] utxo_common:2029] utxo_common:1970] None instruction 1 of script Script { data: 47304402200d8864318a9d6c1fcbfa1819010214c42dc1f9e82ca55059121e48f478f3e11c0220609552cf06cf55d767d92fefc0753fdde8b4924866034054bd38b081c6862fca01 }"
        }
    }
},

None => return ERR!("None instruction 1 of script {:?}", script),

The taker fee validation is attempting to validate that all inputs have been signed by the taker's pubkey. If any of these inputs are P2PK(as opposed to P2PKH or P2WPKH), the validation will fail unexpectedly.

If this check will remain in place, the check_all_utxo_inputs_signed_by_pub function must account for P2PK inputs. This function should recalculate the sighash for this input and validate the provided signature against the expected public key.

@shamardy shamardy added priority: urgent Critical tasks requiring immediate action. bug: swap labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: swap priority: urgent Critical tasks requiring immediate action.
Projects
None yet
Development

No branches or pull requests

2 participants