Skip to content

Instantly share code, notes, and snippets.

@n8maninger
Last active November 26, 2019 23:00
Show Gist options
  • Save n8maninger/bef3e9bb3fa19307d5674db4d58886c0 to your computer and use it in GitHub Desktop.
Save n8maninger/bef3e9bb3fa19307d5674db4d58886c0 to your computer and use it in GitHub Desktop.
Sia Contract Payout Example

Contract formation at block height 221260

Hastings SC
Payout 2696978408391642003625221920 2696.98
Siafund Dividend 10518215792727404000000000 10.51 SC
Miner Fees 61440000000000000000000 0.06144

Contract Valid Proof Outputs

Hastings SC
Returned Renter Allowance 1591646250464367965483841920 1591.65
Host Payout + Collateral 1000150000000000000000000000 1000.15

Contract Missed Proof Outputs

Hastings SC
Returned Renter Allowance 1591646250464367965483841920 1591.65
Returned Collateral 1000150000000000000000000000 1000.15
Burnt Collateral 0 0

Siacoin Host Input

{
	"id": "0bdb692ade36dadc3a62b76a6f52574f39b51f13a60ddacfa5792b586a4dde14",
	"unlock_hash": "4f73058f7ca7b21cb3216409bc4505087940cf770ad5ca4dfe43b4e307649e91140643e7a0ba",
	"amount": 1000000000000000000000000000
}

Siacoin Renter Input

{
	"id": "2dd83f59522619a8fbb6d724b0342c77c6a7440c4b5a68972c7585da6ee6dc2a",
	"unlock_hash": "2126d2831087795ef71f70250baad006dd6be90c570e1d9c77b50fe7262173fb7bb1f2adb899",
	"amount": 1697039848391642003625221920
}

Contract revision at block height 233794

Hastings SC
Miner Fees 40020000000000000000000 0.04002

Revision Valid Proof Outputs

Hastings SC
Returned Renter Allowance 840999683582092705554082151 840.1
Host Payout + Collateral 1750796566882275259929759769 1750.8

Revision Missed Proof Outputs

Hastings SC
Returned Renter Allowance 840999683582092705554082151 840.1
Returned Collateral 0 0
Burnt Collateral 1750796566882275259929759769 1750.8

Siacoin Host Input

{
	"id": "ecd06303f22d7b1e6c1a09f6868c93e2080590f6ffdd69c4003355b1db543b0b",
	"unlock_hash": "87c2abac6f9af5e5383b552886a602d787ff9bd14155f1f1c9aadddaa81b7282b09a37ed0565",
	"amount": 40020000000000000000000
}

Totals

Reported

Hastings SC
Contract Cost 150000000000000000000000 0.15
Locked Collateral 1000000000000000000000000000 1000
Risked Collateral 1582884321131850000000000000 1582.88
Download Revenue 67654605043327700000000 0.07
Storage Revenue 671639597195983000000000000 671.64
Upload Revenue 70027678168341000000000000 70.03
Transaction Fees 84780000000000000000000 0.08
Host Input 1582884321131850000000000000 1582.88
Host Payout 2324854031101220000000000000 2324.85
Host Revenue 741969709969367000000000000 741.97

Actual

Hastings SC
Host Input 1000040020000000000000000000 1000.04002
Miner Fees 101460000000000000000000 0.10146
Host Payout + Collateral 1750796566882275259929759769 1750.80
Host Revenue 750716526882270000000000000 750.7165269

Contract output from my Sia host

{
	"contractcost": "150000000000000000000000",
	"datasize": 1048877989888,
	"lockedcollateral": "1000000000000000000000000000",
	"obligationid": "7a35aaea39f6fb824dee9374d083bf7a0879abe24d3ef6df4c5b8305e0a9be5f",
	"potentialdownloadrevenue": "67654605043327785113231",
	"potentialstoragerevenue": "671639597195983121553555456",
	"potentialuploadrevenue": "70027678168341040064704512",
	"riskedcollateral": "1582884321131859302445744128",
	"sectorrootscount": 0,
	"transactionfeesadded": "84780000000000000000000",
	"transactionid": "c8269a7830fa9683652101c0ad32ce2f0eb58f0802485de82180940f60645642",
	"expirationheight": 233937,
	"negotiationheight": 221259,
	"proofdeadline": 234081,
	"obligationstatus": "obligationSucceeded",
	"originconfirmed": true,
	"proofconfirmed": true,
	"proofconstructed": false,
	"revisionconfirmed": true,
	"revisionconstructed": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment