Bitcoin Forum
May 02, 2024, 02:21:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to disable or break TX push when using sendtoaddress?  (Read 629 times)
21st-century (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
April 14, 2014, 10:14:55 PM
 #1

I am in the process of writing some code at the moment and I'm looking for a way to use the official Bitcoin client for as much of this as possible. Basically, I would like to find a way to return a raw transaction representing the result from executing a JSON-RPC sendtoaddress call but without sending the actual transaction. As far as I can tell, the Bitcoind's API doesn't support this, but there might yet be a way to programmatically break the daemon and convince Bitcoin the TX was sent when it wasn't. Perhaps by manipulating connected peers? Actually I don't even need the raw transaction. I just need the transaction ID and a guarantee the transaction it was derived from hasn't been sent.

Any help would be appreciated Wink
1714659666
Hero Member
*
Offline Offline

Posts: 1714659666

View Profile Personal Message (Offline)

Ignore
1714659666
Reply with quote  #2

1714659666
Report to moderator
1714659666
Hero Member
*
Offline Offline

Posts: 1714659666

View Profile Personal Message (Offline)

Ignore
1714659666
Reply with quote  #2

1714659666
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714659666
Hero Member
*
Offline Offline

Posts: 1714659666

View Profile Personal Message (Offline)

Ignore
1714659666
Reply with quote  #2

1714659666
Report to moderator
1714659666
Hero Member
*
Offline Offline

Posts: 1714659666

View Profile Personal Message (Offline)

Ignore
1714659666
Reply with quote  #2

1714659666
Report to moderator
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
April 14, 2014, 11:17:04 PM
 #2

What language are you writing your code in? You can just use the raw transaction api without tinkering with the source code?

Bitwasp Developer.
21st-century (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
April 14, 2014, 11:26:09 PM
 #3

What language are you writing your code in? You can just use the raw transaction api without tinkering with the source code?

I am using Python and yes, indeed, I can use raw transactions but the advantage of the sendtoaddress function is it automatically takes care of combining inputs, handling fees, and setting up outputs for change. That is tedious work I might get wrong if I try re-implement. I am currently making progress with hacking Bitcoin not to send the transaction. It involves setting connect=127.0.0.1 in the config, killing the daemon after the sendtoaddress and then removing the database entry. Bitcoin can't send the transaction like this but still returns a TX ID. It's kind of worse than just manually implementing sendtoaddress so I probably won't be using this.

Do you know of any good libraries that might help replicate sendtoaddress?
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
April 16, 2014, 08:22:11 AM
 #4

I'm not so sure on python! but since you're already hacking bitcoind you're probably on the right track. Maybe create a duplicate of sendtoaddress that only returns the raw transaction?

Otherwise you're right, you'd have to do a lot of coding yourself just to piece together essentially the same thing bitcoind does.

Bitwasp Developer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!