Bitcoin

How to distinguish between BTC and BRC20 transactions on the blockchain?

How to distinguish between BTC transactions and BRC20 transactions on a blockchain using the RCP interface?

Transaction record containing BRC20 tokens found in Blockchain Explorer.

When using RPC to scan a block and retrieve transaction history like this, how can I use Python3 to check if a transaction is BRC20 or BTC?


    "hash": "331d02db3d6ee0cffae9052be5799bd7754c6ebb2020e422058b73334c59bf85",
    "ver": 2,
    "vin_sz": 1,
    "vout_sz": 2,
    "size": 359,
    "weight": 734,
    "fee": 7360,
    "relayed_by": "0.0.0.0",
    "lock_time": 0,
    "tx_index": 4705820269244017,
    "double_spend": false,
    "time": 1682913851,
    "block_index": 787738,
    "block_height": 787738,
    "inputs": (
        
            "sequence": 4294967293,
            "witness": "03405d88c3c66893b950a42d3672f3009a9f15e674f248a1d1c435609440b91e426598d9505752c560b24ba6261f1b3c7e997941006c9ead7b0378ca7c92c65519418320117f692257b2331233b5705ce9c682be8719ff1b2b64cbca290bd6faeb54423eac061b237bd58701750063036f7264010118746578742f706c61696e3b636861727365743d7574662d3800357b2270223a226272632d3230222c226f70223a226d696e74222c227469636b223a2266726565222c22616d74223a2231303030227d6821c0117f692257b2331233b5705ce9c682be8719ff1b2b64cbca290bd6faeb54423e",
            "script": "",
            "index": 0,
            "prev_out": 
                "addr": "bc1pejeuynu5edq5fvfa8elpkem6zuzvrvqx20zundhpyuy3h3y8wumslwyd5h",
                "n": 0,
                "script": "5120ccb3c24f94cb4144b13d3e7e1b677a1704c1b00653c5c9b6e127091bc4877737",
                "spending_outpoints": (
                    
                        "n": 0,
                        "tx_index": 4705820269244017
                    
                ),
                "spent": true,
                "tx_index": 6896182349770388,
                "type": 0,
                "value": 10000
            
        
    ),
    "out": (
        
            "type": 0,
            "spent": false,
            "value": 546,
            "spending_outpoints": (),
            "n": 0,
            "tx_index": 4705820269244017,
            "script": "51208873ed390476c5c7b6c825bae7eca675a46bc200cc7a82354b0debec19f83abc",
            "addr": "bc1p3pe76wgywmzu0dkgykaw0m9xwkjxhssqe3agyd2tph47cx0c827qd4yq9x"
        ,
        
            "type": 0,
            "spent": true,
            "value": 2094,
            "spending_outpoints": (
                
                    "tx_index": 1274202281123575,
                    "n": 0
                
            ),
            "n": 1,
            "tx_index": 4705820269244017,
            "script": "0014ea410b1701aeaa64dbf721cd55fce1231f2144a3",
            "addr": "bc1qafqsk9cp464xfklhy8x4tl8pyv0jz39rhhh0s7"
        
    )


How to analyze? Witness Component 1, Witness Component 2, Witness Component 3.

What if I want a complete analysis?

The analogy is as follows:


  "p": "brc-20",
  "op": "mint",
  "tick": "free",
  "amt": "1000"

ID 331d02db3d6ee0cffae9052be5799bd7754c6ebb2020e422058b73334c59bf85i0
Length 53
Type text/plain;charset=utf-8
Timestamp 01 May 2023 12:04:11
Block height 787738
Size 133
Standard: brc-20
Operation: mint
Token: free
Amount: 1000

Related Articles

Back to top button