VeChain werkt samen met BMW

VeChain is een samenwerking aangegaan met de grote Duitse autofabrikant BMW. Samen gaan ze een autobeveiligingsplatform maken. Hiermee moet worden voorkomen dat auto’s en andere (BMW) voertuigen niet meer vervalst kunnen worden. Deze grote samenwerking werd door de crypto community goed ontvangen. Is dit ook in de VeChain koers terug te zien? Gedecentraliseerde app BMW en Vechain De twee bedrijven zijn van plan om de op blockchain gebaseerde gedecentraliseerde applicatie (dApp) VerifyCar te ontwikkelen. VerifyCar verzamelt gegevens zoals kilometerstand, reparaties […]

Het bericht VeChain werkt samen met BMW verscheen eerst op

SPV client TCP connection in python

I am trying to implement an SPV client in python (for my own learning). I want to start by making a simple TCP connection to a full node, but I either cannot get a response to my version message, or to my verack message if the version message goes through. I have referenced this and this is the code that I am trying to run:

#Import dependencies
import socket
import time
import random
import struct
import hashlib
import binascii
import ssl
import socks

# Binary encode the sub-version
def create_sub_version():
    sub_version = "/Satoshi:0.7.2/"
    return b'\x0F' + sub_version.encode()

# Binary encode the network addresses
def create_network_address(ip_address, port):
    network_address = struct.pack('>8s16sH', b'\x01', 
        bytearray.fromhex("00000000000000000000ffff") + socket.inet_aton(ip_address), port)

# Create the TCP request object
def create_message(magic, command, payload):
    checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[0:4]
    return(struct.pack('L12sL4s', magic, command.encode(), len(payload), checksum) + payload)

# Create the "version" request payload
def create_payload_version(peer_ip_address):
    version = 60002
    services = 1
    timestamp = int(time.time())
    addr_local = create_network_address("", 8333)
    addr_peer = create_network_address(peer_ip_address, 8333)
    nonce = random.getrandbits(64)
    start_height = 645953
    payload = struct.pack('<LQQ26s26sQ16sL', version, services, timestamp, addr_peer,
                          addr_local, nonce, create_sub_version(), start_height)

# Create the "verack" request message
def create_message_verack():
    return bytearray.fromhex("f9beb4d976657261636b000000000000000000005df6e0e2")

# Create the "getdata" request payload
def create_payload_getdata(tx_id):
    count = 1
    type = 1
    hash = bytearray.fromhex(tx_id)
    payload = struct.pack('<bb32s', count, type, hash)

# Print request/response data
def print_response(command, request_data, response_data):
    print("Command: " + command)

if __name__ == '__main__':
    # Set constants
    magic_value = 0xd9b4bef9
    tx_id = "a13e7979d3607e187d2ce81ca9fdadfe967b2f3fc1109ce47d46cc09ebd41c50"
    peer_ip_address = socket.gethostbyname('') 
    peer_tcp_port =  50002
    buffer_size = 1024

    # Create Request Objects
    version_payload = create_payload_version(peer_ip_address)
    version_message = create_message(magic_value, 'version', version_payload)
    verack_message = create_message_verack()
    getdata_payload = create_payload_getdata(tx_id)
    getdata_message = create_message(magic_value, 'getdata', getdata_payload)

    # Establish TCP Connection
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    ws = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
    ws.connect((peer_ip_address, peer_tcp_port))

    # Send message "version"
    response_data = ws.recv(buffer_size)
    print_response("version", version_message, response_data)

    # Send message "verack"
    response_data = ws.recv(buffer_size)
    print_response("verack", verack_message, response_data)

    # Send message "getdata"
    response_data = ws.recv(buffer_size)
    print_response("getdata", getdata_message, response_data)

    # Close the TCP connection

The server I connect to in the code is among the only ones that would respond to the version message, returning b’7b226a736f6e727063223a2022322e30222c20226572726f72223a207b22636f6465223a202d33323730302c20226d657373616765223a20226d65737361676573206d75737420626520656e636f64656420696e205554462d38227d2c20226964223a206e756c6c7d0a’.

I also tried referencing: this stack exchange question and Ken Shirriff’s github code, but none seem to work, either because I am using python3 or from other causes. I am a beginner in this, so if somebody could help me understand why I cannot get my messages across in the above code or has another implementation in python3, I would be grateful.

Error opening block database Full node

For some reason my node shutdown and now I get when restart it

Error opening block database

here my bitcoin.conf

# Accept command line and JSON-RPC commands.
# Options only for mainnet
# Options only for testnet
# Options only for regtest

this is my debug.log

2020-08-29T07:17:24Z Bitcoin Core version v0.19.1 (release build)
2020-08-29T07:17:24Z Assuming ancestors of block 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf have valid signatures.
2020-08-29T07:17:24Z Setting nMinimumChainWork=000000000000000000000000000000000000000008ea3cf107ae0dec57f03fe8
2020-08-29T07:17:24Z Using the 'standard' SHA256 implementation
2020-08-29T07:17:24Z Default data directory /home/bitcoin/.bitcoin
2020-08-29T07:17:24Z Using data directory /home/bitcoin/.bitcoin
2020-08-29T07:17:24Z Config file: /home/bitcoin/.bitcoin/bitcoin.conf
2020-08-29T07:17:24Z Using at most 125 automatic connections (1024 file descriptors available)
2020-08-29T07:17:24Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2020-08-29T07:17:24Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2020-08-29T07:17:24Z Using 4 threads for script verification
2020-08-29T07:17:24Z HTTP: creating work queue of depth 16
2020-08-29T07:17:24Z No rpcpassword set - using random cookie authentication.
2020-08-29T07:17:24Z scheduler thread start
2020-08-29T07:17:24Z Generated RPC authentication cookie /home/bitcoin/.bitcoin/.cookie
2020-08-29T07:17:24Z HTTP: starting 4 worker threads
2020-08-29T07:17:24Z Using wallet directory /home/bitcoin/.bitcoin
2020-08-29T07:17:24Z init message: Verifying wallet(s)...
2020-08-29T07:17:24Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2020-08-29T07:17:24Z Using wallet /home/bitcoin/.bitcoin
2020-08-29T07:17:24Z BerkeleyEnvironment::Open: LogDir=/home/bitcoin/.bitcoin/database ErrorFile=/home/bitcoin/.bitcoin/db.log
2020-08-29T07:17:24Z init message: Loading banlist...
2020-08-29T07:17:24Z Cache configuration:
2020-08-29T07:17:24Z * Using 2.0 MiB for block index database
2020-08-29T07:17:24Z * Using 56.0 MiB for transaction index database
2020-08-29T07:17:24Z * Using 8.0 MiB for chain state database
2020-08-29T07:17:24Z * Using 384.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2020-08-29T07:17:24Z init message: Loading block index...
2020-08-29T07:17:24Z LevelDB using max_open_files=64 (default=1000)
2020-08-29T07:17:24Z Wiping LevelDB in /home/bitcoin/.bitcoin/blocks/index
2020-08-29T07:17:24Z Opening LevelDB in /home/bitcoin/.bitcoin/blocks/index
2020-08-29T07:17:24Z leveldb: Delete type=3 #1
2020-08-29T07:17:24Z Opened LevelDB successfully
2020-08-29T07:17:24Z Using obfuscation key for /home/bitcoin/.bitcoin/blocks/index: 0000000000000000
2020-08-29T07:17:24Z WriteBatch memory usage: db=index, before=0.0MiB, after=0.0MiB
2020-08-29T07:17:24Z Initializing databases...
2020-08-29T07:17:24Z LevelDB using max_open_files=64 (default=1000)
2020-08-29T07:17:24Z Wiping LevelDB in /home/bitcoin/.bitcoin/chainstate
2020-08-29T07:17:24Z Fatal LevelDB error: IO error: /home/bitcoin/.bitcoin/chainstate/449175.ldb: Bad message
2020-08-29T07:17:24Z You can use -debug=leveldb to get more complete diagnostic messages
2020-08-29T07:17:24Z Fatal LevelDB error: IO error: /home/bitcoin/.bitcoin/chainstate/449175.ldb: Bad message
2020-08-29T07:17:24Z Error: Error opening block database
Error: Error opening block database
2020-08-29T07:17:24Z Shutdown: In progress...
2020-08-29T07:17:24Z scheduler thread interrupt
2020-08-29T07:17:24Z Shutdown: done

Where can I find the core binaries for v.0.1.5 to v.0.3.21?

I have been looking for core binaries (i.e. win32-setup.exe & & for earlier clients. Any advice on where they are hosted? They have all been removed from SourceForge.

Any advice appreciated!

What are “tagged” Bitcoins?

I was reading about the Sheep Marketplace:

Victims of the theft have attempted to identify the thief by sending "tagged" bitcoins to his accounts, using the public nature of bitcoin transactions to follow these moneys through the "blockchain" record of transfers.

What are "tagged" Bitcoins and how do they work? How do they differ from regular Bitcoins?

How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?

I have stored my bitcoins on Bitcoin Core in a few P2PKH addresses with many UTXOs. I would like to have a plan, how these bitcoins can be moved air-gapped to a more up-to-date setup (not discussed here).

I have not touched this computer (OFFLINE) for many years and I am afraid to connect it to the internet.

I assume that I need to have access to the lastest UTXO set and then create air-gapped transactions. But how exactly can this be done?

Is it possible to setup a Bitcoin Core on another online computer (ONLINE) and import the addresses using "importaddress"?

Is it (and how) possible to create an unsigned transaction on this ONLINE computer including all UTXOs of one of the imported (watch-only) addresses?

And then move this unsigned transaction to the old offline computer (OFFLINE) with the old wallet.dat file and sign the transaction?

Is this possible or is there another way to do this air-gapped?

Has anyone documented all the necessary steps?

Thanks for your help!

-A frightened hodler