opreturn.net


Retrieve p2shdata from transaction
P2SHDATA
txid: 46252a07be3ffe38e2009af59b8b75ce1748d89f075d193059b0e4a16fa34b91
P2SHDATA protocol is a method for encoding and storing data on the Bitcoin blockchain, especially designed for larger files compared to the standard OP_RETURN mechanism. 

Here's a breakdown of how P2SHDATA works to save larger files:

-- P2SH Addresses and Script Storage: P2SH (Pay-to-Script-Hash) allows you to pay to a hash of a script instead of a public key directly. The actual script (called the redeemScript) is not revealed on the blockchain until the funds are spent. P2SHDATA utilizes this by encoding data into the redeemScript itself.

-- Chunking Large Files: To store a larger file, the P2SHDATA protocol splits the file into multiple chunks, each up to a certain size (e.g., 500 bytes).

-- Deriving Addresses from Chunks: Each chunk of data is used to derive a unique P2SH address, essentially embedding the chunk's information within the address creation process.

-- Funding the Addresses: These derived addresses are then funded with a small amount of Bitcoin in the first transaction.

-- Revealing the Data: In a subsequent transaction, the funds from all these addresses are spent and sent to a destination address. The key to this step is that when you spend funds from a P2SH address, the redeemScript (containing the chunk of data) must be revealed to the network.

-- Reconstructing the File: The second transaction also includes an OP_RETURN output which contains metadata like filename, filetype, and a hash of the original data. This metadata, combined with the revealed data chunks from the redeemScripts, enables reconstruction of the original file. 

-- Why P2SHDATA for Larger Files: Compared to OP_RETURN, which typically has an 80-byte limit (though recent changes might alter this slightly), P2SHDATA offers a mechanism for storing significantly larger amounts of data by leveraging the structure of P2SH transactions and splitting data into manageable chunks. 
P2SHDATA METADATA

{
    "txid": "46252a07be3ffe38e2009af59b8b75ce1748d89f075d193059b0e4a16fa34b91",
    "coin": "grlc",
    "filename": "P2SHDATAprotocol.asc",
    "filetype": "asc",
    "assembly": "0bdc0003ec00cd6173636969",
    "scriptbytes": 11,
    "script": "dc0003ec00cd6173636969",
    "start": 0,
    "end": 3,
    "encode": "00",
    "encode_desc": "ascii",
    "content_code": "6173636969",
    "content_desc": "ascii",
    "payloadhash160": "2a942bc4ad18b8b4710d442f1db86f69a7219599",
    "op_datahash160": "2a942bc4ad18b8b4710d442f1db86f69a7219599"
}