b2network / b2-node

Ethermint is a Cosmos SDK library for running scalable and interoperable EVM chains
https://docs.evmos.org/
GNU Lesser General Public License v3.0
3 stars 7 forks source link

sending btc transactions with schnorr multi-signature #72

Open robertcc0410 opened 6 months ago

robertcc0410 commented 6 months ago

l2-->l1 sending btc transactions with schnorr multi-signature

oxf71 commented 6 months ago

https://github.com/btcsuite/btcd/blob/master/btcec/schnorr/musig2/musig2_test.go

oxf71 commented 6 months ago

schnorr musig2 demo:

https://github.com/oxf71/musig2-demo

oxf71 commented 5 months ago

taproot transaction use musig2 example: https://github.com/oxf71/musig2-demo/blob/main/example/taprootmusig/main.go

todo:

robertcc0410 commented 5 months ago

schnorr multi-signature done(n-n) Notice:

    unspentOutputs := make([]*btcapi.UnspentOutput, 0)
    for _, utxo := range utxos {
        txHash, err := chainhash.NewHashFromStr(utxo.Txid)
        if err != nil {
            return nil, err
        }
        pkScript, err := txscript.PayToAddrScript(address)
        if err != nil {
            return nil, err
        }

        unspentOutputs = append(unspentOutputs, &btcapi.UnspentOutput{
            Outpoint: wire.NewOutPoint(txHash, uint32(utxo.Vout)),
            Output:   wire.NewTxOut(utxo.Value, pkScript),
        })
    }
    return unspentOutputs, nil

Need to implement psbt multi-signature transactions(m-n)

oxf71 commented 5 months ago

https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#basic-multisig-example