import requests import hashlib class OrdinalScanner: def __init__(self, node_url): self.node_url = node_url self.explorers = ['ordiscan.com', 'gamma.io', 'ord.io'] def get_sat_info(self, sat_number): """Get detailed information about a specific sat""" for explorer in self.explorers: try: data = self.query_explorer(explorer, sat_number) if data: return { 'sat_number': sat_number, 'sat_name': data.get('name', ''), 'block': data.get('block', ''), 'rarity': self.determine_rarity(sat_number, data), 'current_owner': data.get('owner', ''), 'inscriptions': data.get('inscriptions', []) } except: continue return None def scan_for_legendary(self, rarity_type): """Scan blockchain for legendary sats of specific rarity""" legendary_sats = [] if rarity_type == 'uncommon': # Scan recent blocks for first sats current_block = self.get_current_block_height() for block in range(current_block - 100, current_block + 1): first_sat = self.get_block_first_sat(block) if first_sat: legendary_sats.append(first_sat) return legendary_sats def track_merkle_route(self, sat_number): """Track a sat's complete merkle route through blockchain""" route = [] current_sat = sat_number while current_sat: tx_data = self.get_sat_transaction(current_sat) if not tx_data: break route.append({ 'block': tx_data['block'], 'txid': tx_data['txid'], 'merkle_root': tx_data['merkle_root'], 'timestamp': tx_data['timestamp'] }) # Follow sat to previous transaction current_sat = self.get_previous_sat_owner(current_sat) return route # Initialize and use scanner = OrdinalScanner('your_bitcoin_node_url') sat_info = scanner.get_sat_info(1259576727822245) merkle_route = scanner.track_merkle_route(1259576727822245) print(f"Sat Name: {sat_info['sat_name']}") print(f"Merkle Route Length: {len(merkle_route)} blocks")