You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to run some blockchain analysis to count how many bitcoins are in unspent outputs secured by public keys that are revealed in some transaction.
I am currently using out.address.script.revealed_tx to identify the outputs which have addresses which are revealed somewhere else. Can you please help me out and let me know if I am on the right path?
Here is my code:
# bitcoins in unspent outputs with addresses revealed in some inputs= []
c= []
foriinrange(len(chain)):
add=0count=0foroutinchain[i].outputs.unspent.all:
try:
out.address.script.revealed_txcount+=1add+=out.valueexceptExceptionase:
passs.append(add)
c.append(count)
ss=np.cumsum(s)
cc=np.cumsum(c)
The text was updated successfully, but these errors were encountered:
You're close. The only thing wrong is that out.address.script.revealed_tx returns None when the address has never been spent rather than throwing an Exception so you just want to use
if out.address.script.revealed_tx:
count += 1
add += out.value
Also btw you can use for block in chain to iterate over blocks
I tried that, but I got IndexOutOfBound Exception, so I assumed the field is just not created in the case the address was never spent from. How does this treat multi-sig scripts. What happens if only one of the public keys in a 2 of 3 multisig address is revealed in some input? Where are you populating this field? I tried to find it in the code :)
Hi, I am trying to run some blockchain analysis to count how many bitcoins are in unspent outputs secured by public keys that are revealed in some transaction.
I am currently using out.address.script.revealed_tx to identify the outputs which have addresses which are revealed somewhere else. Can you please help me out and let me know if I am on the right path?
Here is my code:
The text was updated successfully, but these errors were encountered: