ladimolnar / BitcoinDatabaseGenerator

A high performance data transfer tool that can be used to transfer data from Bitcoin Core blockchain files to a SQL Server database
Apache License 2.0
122 stars 53 forks source link

scama #9

Closed gdog1212 closed 7 years ago

gdog1212 commented 7 years ago

witch data base field would hold the signature to release the inputs to the new out puts?

ladimolnar commented 7 years ago

A transaction is made from a bunch of inputs and a bunch of outputs. Each input redeems funds that are locked in a previous output. The proof that the input is entitled to consume those funds is contained in the “input script”. This field is not stored in the database. I considered this field to be less interesting since the proof was already made and the funds were already consumed. By consumed I mean transferred to a new output where they were locked. Each output locks a quantity of bitcoins. The output contains in its “output script” the conditions needed to release the funds later. That is what I considered to be interesting - that is what one needs to “unlock” in order to spend funds in a future transaction. This field is stored in the database in table TransactionOutput, column OutputScript.

If for whatever reason, you need the “input script”, that would be a relatively easy change to make but you’ll need to make it yourself. The BitcoinDatabaseGenerator tool relies on a parser implemented in a NuGet package called BitcoinBlockchain (see https://github.com/ladimolnar/BitcoinBlockchain). The parser implemented there does provide access to the “input script”. The change would be relatively simple: add a new column to table TransactionInput, then make sure that the “input script” is propagated from the dataset produced by the parser all the way to the database. If that is what you need, I could give you a few more details.