Documentation ¶
Index ¶
- Variables
- func ApplyChangeConditionSet(db kv.DB, transaction tx.Tx, vuln *Map)
- func ApplyChangeSet(db kv.DB, c *cache.Cache, transaction tx.Tx, heuristicsList Mask, vuln *Map)
- func ApplyConditionSet(db kv.DB, transaction tx.Tx, vuln *Mask)
- func ApplyFullSet(db kv.DB, c *cache.Cache, transaction tx.Tx, vuln *Mask)
- func ApplySet(db kv.DB, c *cache.Cache, transaction tx.Tx, heuristicsList Mask, vuln *Mask)
- type Condition
- type ConditionsSet
- type Heuristic
- func (h Heuristic) Apply(db kv.DB, c *cache.Cache, transaction tx.Tx, vuln *Mask)
- func (h Heuristic) ApplyChange(db kv.DB, ca *cache.Cache, transaction tx.Tx, vuln *Map)
- func (h Heuristic) ApplyChangeCondition(db kv.DB, transaction tx.Tx, vuln *Map)
- func (h Heuristic) ApplyCondition(db kv.DB, transaction tx.Tx, vuln *Mask)
- func (h Heuristic) ConditionFunction() func(*tx.Tx) bool
- func (h Heuristic) Implementation(db kv.DB, ca *cache.Cache) HeuristicImpl
- func (h Heuristic) String() string
- type HeuristicImpl
- type Map
- func (v Map) IsCoinbase() bool
- func (v Map) IsOffByOneBug() bool
- func (v Map) IsPeelingLike() bool
- func (v Map) IsSelfTransfer() bool
- func (v Map) MajorityOutput(reducing ...Heuristic) (r Map, output uint32)
- func (v Map) ToHeuristicsList() (heuristics []string)
- func (v Map) ToList() (heuristics []Heuristic)
- func (v Map) ToMask() (m Mask)
- type Mask
- func (v Mask) IsCoinbase() bool
- func (v Mask) IsOffByOneBug() bool
- func (v Mask) IsPeelingLike() bool
- func (v Mask) IsSelfTransfer() bool
- func (v *Mask) Sum(m Mask) Mask
- func (v Mask) ToHeuristicsList() (heuristics []string)
- func (v Mask) ToList() (heuristics []Heuristic)
- func (v Mask) VulnerableMask(h Heuristic) (vuln bool)
Constants ¶
This section is empty.
Variables ¶
var MajorityLikelihood = map[byte]float64{ byte(0b10011101): 100.00, byte(0b10011100): 100.00, byte(0b10011): 96.06, byte(0b10111): 93.85, byte(0b10010000): 99.99, byte(0b10001101): 100.00, byte(0b10001): 94.18, byte(0b11000): 100.00, byte(0b10001001): 100.00, byte(0b10010001): 100.00, byte(0b10010010): 100.00, byte(0b10110): 91.87, byte(0b100): 61.50, byte(0b1): 58.32, byte(0b1001): 83.78, byte(0b10011001): 100.00, byte(0b1000): 90.33, byte(0b10010101): 100.00, byte(0b10001000): 99.92, byte(0b11): 96.09, byte(0b0): 87.23, byte(0b10000): 96.57, byte(0b10000110): 100.00, byte(0b10001100): 99.93, byte(0b101): 80.60, byte(0b10000001): 100.00, byte(0b1101): 80.50, byte(0b10010100): 100.00, byte(0b1100): 79.09, byte(0b10000000): 95.66, byte(0b10000010): 100.00, byte(0b10000100): 99.76, byte(0b10): 96.05, byte(0b10000101): 100.00, byte(0b10010110): 100.00, byte(0b11100): 100.00, byte(0b111): 72.94, byte(0b11001): 100.00, byte(0b10011000): 100.00, byte(0b10000111): 100.00, byte(0b110): 59.63, byte(0b10010111): 100.00, byte(0b10100): 78.78, byte(0b10000011): 100.00, byte(0b11101): 100.00, byte(0b10101): 66.49, byte(0b10010): 99.02, byte(0b10010011): 100.00, }
MajorityLikelihood mapp to define majority voting probability
Functions ¶
func ApplyChangeConditionSet ¶
ApplyChangeConditionSet applies the set of passed heuristics to the passed transaction
func ApplyChangeSet ¶
ApplyChangeSet applies the set of passed heuristics to the passed transaction
func ApplyConditionSet ¶
ApplyConditionSet applies the set of passed heuristics to the passed transaction
func ApplyFullSet ¶
ApplyFullSet applies the set of heuristics to the passed transaction
Types ¶
type ConditionsSet ¶
type ConditionsSet []Condition
ConditionsSet defines the list of transacions applicable conditions
type Heuristic ¶
type Heuristic int
Heuristic type define a enum on implemented heuristics
func Abbreviation ¶
Abbreviation returns vulnerable function to be applied to analysis
func SetCardinality ¶
func SetCardinality() Heuristic
SetCardinality returns the cardinality of the heuristics set
func (Heuristic) ApplyChange ¶
ApplyChange applies the heuristic specified to the passed transaction
func (Heuristic) ApplyChangeCondition ¶
ApplyChangeCondition applies the heuristic specified to the passed transaction
func (Heuristic) ApplyCondition ¶
ApplyCondition applies the heuristic specified to the passed transaction
func (Heuristic) ConditionFunction ¶
ConditionFunction returns change output function to be applied to analysis
func (Heuristic) Implementation ¶
Implementation returns concrete implementation for the heuristic
type HeuristicImpl ¶
type HeuristicImpl interface { ChangeOutput(transaction *tx.Tx) (c []uint32, err error) Vulnerable(transaction *tx.Tx) bool }
HeuristicImpl generic heuristic methods interface
type Map ¶
Map analysis output map for heuristics change output
func MapFromHeuristics ¶
MapFromHeuristics intialized a null map with passed heuristics as keys
func (Map) IsCoinbase ¶
IsCoinbase checks if corresponding condition bit is true
func (Map) IsOffByOneBug ¶
IsOffByOneBug checks if corresponding condition bit is true
func (Map) IsPeelingLike ¶
IsPeelingLike checks if corresponding condition bit is true
func (Map) IsSelfTransfer ¶
IsSelfTransfer checks if corresponding condition bit is true
func (Map) MajorityOutput ¶
MajorityOutput extract the majority output set from map
func (Map) ToHeuristicsList ¶
ToHeuristicsList return a list of heuristic names corresponding to vulnerability byte passed
type Mask ¶
type Mask [3]byte
Mask struct to represent heuristics vulnerability mask
func FromListToMask ¶
FromListToMask convert list of heuristics to mask type
func MaskFromPower ¶
MaskFromPower returns the mask byte from the power of 2
func MergeMasks ¶
MergeMasks uses bitwise OR operation to apply a mask to vulnerabilities byte to merge a new mask with updated heuristics bit and return the merge between original byte with updated bits
func (Mask) IsCoinbase ¶
IsCoinbase checks if corresponding condition bit is true
func (Mask) IsOffByOneBug ¶
IsOffByOneBug checks if corresponding condition bit is true
func (Mask) IsPeelingLike ¶
IsPeelingLike checks if corresponding condition bit is true
func (Mask) IsSelfTransfer ¶
IsSelfTransfer checks if corresponding condition bit is true
func (Mask) ToHeuristicsList ¶
ToHeuristicsList return a list of heuristic names corresponding to vulnerability byte passed
func (Mask) ToList ¶
ToList return a list of heuristic integers corresponding to vulnerability byte passed
func (Mask) VulnerableMask ¶
VulnerableMask uses bitwise AND operation to apply a mask to vulnerabilities byte to extract value bit by bit and returns true if the vuln byte is vulnerable to passed heuristic
Directories ¶
Path | Synopsis |
---|---|
Package backward heuristic It checks the transactions that come before the one in which we want to find the change address.
|
Package backward heuristic It checks the transactions that come before the one in which we want to find the change address. |
Package behaviour client heuristic This heuristic checks if there are output addresses that are the first time they appear in the Blockchain.
|
Package behaviour client heuristic This heuristic checks if there are output addresses that are the first time they appear in the Blockchain. |
Package forward heuristic It checks the transactions that come after the one in which we want to find the change address.
|
Package forward heuristic It checks the transactions that come after the one in which we want to find the change address. |
Package locktime heuristic It checks for each output of a transaction, if the spending transactions locktime is the same of the original transaction.
|
Package locktime heuristic It checks for each output of a transaction, if the spending transactions locktime is the same of the original transaction. |
Package optimal change heuristic It tries to locate in the output set of a transaction an address that receives an amount which is smaller or equal than all inputs values.
|
Package optimal change heuristic It tries to locate in the output set of a transaction an address that receives an amount which is smaller or equal than all inputs values. |
Package peeling chain heuristic Since in this case we are looking for a set of transactions that have different length, can be really difficult to be sure that a series of transactions that have one input and two outputs is a peeling chains transaction, also because a chain can be connected in the middle point of another chain.
|
Package peeling chain heuristic Since in this case we are looking for a set of transactions that have different length, can be really difficult to be sure that a series of transactions that have one input and two outputs is a peeling chains transaction, also because a chain can be connected in the middle point of another chain. |
Package power of ten heuristic It checks if in the outputs set there are addresses that have an amount in Satoshi that is a power of ten.
|
Package power of ten heuristic It checks if in the outputs set there are addresses that have an amount in Satoshi that is a power of ten. |
Package reuse heuristic This heuristic just checks if an address that appears in the input set, appears also in the output set, we just need to count the number of transactions in which this condition is satisfied.
|
Package reuse heuristic This heuristic just checks if an address that appears in the input set, appears also in the output set, we just need to count the number of transactions in which this condition is satisfied. |
Package shadow heuristic This heuristic checks if there are output addresses that are the first time they appear in the Blockchain.
|
Package shadow heuristic This heuristic checks if there are output addresses that are the first time they appear in the Blockchain. |
Package class heuristic This heuristic is the address type heuristic and it checks if the all the inputs are of the same type and then try to locate only one output that is of the same type.
|
Package class heuristic This heuristic is the address type heuristic and it checks if the all the inputs are of the same type and then try to locate only one output that is of the same type. |