Bitcoin Forum
June 25, 2024, 03:54:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Electrum / Electrum Wallet Python and OP-Return on: January 19, 2023, 08:02:43 PM
Hej

Overwelmed by the https://chat.openai.com/ I tested some help for my long time desire to write on the Blockchain, I asked

Please give me some directions how  to write "Hello World" for ever on the Blockchain using Python.

This was the answer:

Here is an example of how to use the "electrum-client" library to create an OP_RETURN transaction with a text message:

from electrum_client import ElectrumClient

# Connect to the Electrum server
client = ElectrumClient('hostname', port=50002, protocol='tcp')

# Create the transaction
tx = client.blockchain.transaction.create(
    inputs=[{'address': 'your_address', 'value': 200000}],
    outputs=[{'address': 'destination_address', 'value': 100000}],
    op_return_data=b"Hello, world!"
)

# Sign the transaction
tx = client.blockchain.transaction.sign(tx, privkey='your_private_key')

# Broadcast the transaction
tx_id = client.blockchain.transaction.broadcast(tx)
print(tx_id)


My Python and Electrum knowledge is below this but I would like some comments on this.

Is the Library good
What is the hostname
Where is the fee......

Best regards
2  Bitcoin / Electrum / Re: Electrum appImage console on: February 27, 2021, 07:45:26 PM

This is a hard question and I am not quite sure I can give a good answer , because the thoughts have a tendency to live its own life without a good thinking behind.

However it started when I realised that installing an appImage was quite easy compared to other Linux installations where the screen is flashing with lines and lines and lines some of them in red which is very scary for an old fashioned Win user.
I also had in mind that the appimage could be kind of VirtualBox installation isolated from rest of the OS.

Further down the line of muddled thougths , wallet transactions would be sent at certain conditions such as date , time, low transaction fees........all this programmed into a wallet.

regards
3  Bitcoin / Electrum / Re: Electrum appImage console on: February 26, 2021, 03:03:05 PM
Thanks for your curiosity and efforts . I will definetely wait for some explanations.

Do you think an standard install without not using the appImage wallet would give other import possibilities.
Or, do you think the the appimage is type of a 'virtual OS' and that the same is true for the wallet as such also.

That was some questions and while on my way......

Can you locate some wallet program example  for me to look at.

Best regards
4  Bitcoin / Electrum / Re: Electrum appImage console on: February 24, 2021, 05:31:23 PM
It comes from a try to do
Pip install bitcoin
from bitcoin import *

Maybe stupid but anyhow a try.

Is the cause of the missing function that this console can not import other libraries
or
is the appimage as such that not allow importing.

regards
5  Bitcoin / Electrum / Electrum appImage console on: February 24, 2021, 12:53:52 PM
Hej
I have a running Electrum Wallet and have started the Console and I have a prompt
Please give me some explanation of what is the explanation of the text ans its meaning.
Please use as simple/basic answer as possible.

regards

>>> 1+2
3
>>>
then I do, with less success

>>> my_private_key = random_key()
 
Traceback (most recent call last):
    my_private_key = random_key()
                   ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electr163Txz/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
NameError: name 'random_key' is not defined
>>>
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!