Categories
Bitcoin Cryptocurrency Development

Is it possible to use Bitcoin-core for multisig? Can it handle change addresses?

I have tried to import three xpub in a watch-only wallet and to fill the first address but when I try to spend, there’s an error instead of creating a psbt. I have generated three xpub: pubkey1 tpubD6NzVbkrYhZ4YKMs9TvzemC7FaKYnNxESKvYN9V6PDnDwBXrHQk97rNC71fCXxyobFgcZDfesc5ThCMkUYjA5edd8J1qUQoR4P3kPywrGw6 pubkey2 tpubD6NzVbkrYhZ4X2MQYSo3wVWBPGjV3fUcN4DywfR2ZcM1F56A2bapN54YJqa47yDvwuTajWqkBHxRmdGHLQJj5ae7V1NXDN2JP8AKcyurzsa pubkey3 tpubD6NzVbkrYhZ4XYeFSXzJ9fFu91eiSEpanzbhifxuSAb7m4piv9QxXsHi2a9jnspQpeKpnpdsyNhoMWb6traBXErL9TPjP3EKnPVFuzyv7Ed then I have created a disable_private_keys wallet. bitcoin-cli -regtest createwallet multi then bitcoin-cli […]

Categories
Bitcoin Cryptocurrency Development

Non SegWit P2SH bytes structure

I’m working on a bitcoin block explorer in golang, in which I’d like to gather as much informations as possible about transactions. I am able to extract addresses from every type of output, and mostly every type of input, except I am struggling to find clear P2SH documentation. BIP16 doesn’t say much about non-SegWit P2SH […]

Categories
Cryptocurrency Development Ethereum

Can a Smart Contract be created by another Smart Contract by the click of a JS button?

I had an interesting thought this morning when I was working on a project that can a smart contract create another smart contract and also deploy it on the blockchain. Like I have a button in my react page and with the click on this button can I call a method on my smart contract […]

Categories
Bitcoin Cryptocurrency Development

Creating beck32 address on bitcoin core automatically generate another address on lightning network

my lightning network backend is bitcoind. Interesting when I execute getnewaddress label bech32 another bech32 address is automatically generated. I found it because at the lightning network console pops up a new line [INF] RPCS: [newaddress] addr=xxxxx and it is not the same as the address at bitcoind. It doesn’t happen if I created with […]

Categories
Bitcoin Cryptocurrency Development

Can a node broadcast a valid signed raw transaction while still syncing?

Built and signed a native bech32 UTXO, but when I attempt to broadcast from my testnet node using the command sendrawtransaction it returns “missing inputs”. I don’t have the private keys in my wallet, and the testnet node is still syncing, but I was able to broadcast it fine with a testnet API service that […]

Categories
Cryptocurrency Development Ethereum

How does the reentrancy attack work?

Consider the following contracts contract Victim{ //… function withdraw(uint amount) public { if (credit[msg.sender] >= amount) { (bool success, ) = msg.sender.call.value(amount)(“”); require(success); credit[msg.sender] -= amount; } } } //… } contract Attack{ Victim victim; //… function () payable { victim.withdraw.value(0)(balance); } } //… My question: how do we initiate attack as an end-user? Scenario […]

Categories
Bitcoin Cryptocurrency Development

What is the scriptCode in a P2WSH transaction?

Let’s say I am spending from a 2-of-2 multisig with this script: 522103c2f21de0f430251d8e3987fbe89ff51f3d6f3a48b234b84b60ddb9f24d587cf52103e0948a03f50377290847d27c93d383b8ab7e2d0bc065e96e0e1136b315388b5452ae OP_2 <len(pubkey1)> <pubkey1> <len(pubkey2)> <pubkey2> OP_2 OP_CHECKMULTISIG What would go in the scriptCode according to BIP143? Is it just the script listed above? Here is the relevant part from BIP143. For P2WSH witness program, – if the witnessScript does not contain any […]

Categories
Cryptocurrency Development Ethereum

Fatal flaw in proof-of-stake?

As I understand it, proof of stake involves staking some ETH for a fixed number of months, and getting the ETH back – with interest – at the end of the period. But, being volatile like most cryptocurrencies, ETH can go down in value. So when the staking period is over and they get their […]

Categories
Cryptocurrency Development Ethereum

Nothing happens whe I run truffle test

I am new to solidity. Maybe I am missing something obvious in the setup. But when I run truffle test, I get nothing, the terminal just stays there forever. $ truffle test … and I don’t know why, and where to debug. My project looks like this: ExamRegistry build contracts Exams.sol Migrations.sol migrations 1_initial_migration.js 2_deploy_contracts.js […]

Categories
Bitcoin Cryptocurrency Development

Bitcoin payment sent and confirmed, but not receieved

I have sent bitcoin before without any problems, but I just don’t know what went wrong with this transaction. On my side the bitcoin transaction is confirmed and when I search up the transaction id on the block chain it also says everything is good and confirmed. However, when I search up the transaction id […]