mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* [NOD-517] Remove copyright notices from all doc.go. * [NOD-517] Updated the root doc.go. * [NOD-517] Remove all cov_report.sh and test_coverage.txt. * [NOD-517] Make all doc.go use the same style of comment. * [NOD-517] Update dagconfig doc.go. * [NOD-517] Update blockdag doc.go. * [NOD-517] Update doc.go in connmgr. * [NOD-517] Update doc.go in fullblocktests. * [NOD-517] Update doc.go in database. * [NOD-517] Update doc.go in ecc. * [NOD-517] Update doc.go in rpctest. * [NOD-517] Removed superfluous license in logs. * [NOD-517] Update doc.go in mempool. * [NOD-517] Updated doc.go in peer. * [NOD-517] Update doc.go in rpcclient. * [NOD-517] Update doc.go in txscript. * [NOD-517] Update doc.go in util. * [NOD-517] Update doc.go in base58. * [NOD-517] Update doc.go in bech32. * [NOD-517] Update doc.go in txsort. * [NOD-517] Update doc.go in wire. * [NOD-517] Fix indentation. * [NOD-517] Add a copyright notice to the main doc.go. * [NOD-517] Add Conformal to the license notices. * [NOD-517] Remove superfluous language from a doc. * [NOD-517] Fix bad example.
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
/*
|
|
Package util provides kaspa-specific convenience functions and types.
|
|
|
|
Block Overview
|
|
|
|
A Block defines a kaspa block that provides easier and more efficient
|
|
manipulation of raw wire protocol blocks. It also memoizes hashes for the
|
|
block and its transactions on their first access so subsequent accesses don't
|
|
have to repeat the relatively expensive hashing operations.
|
|
|
|
Tx Overview
|
|
|
|
A Tx defines a kaspa transaction that provides more efficient manipulation of
|
|
raw wire protocol transactions. It memoizes the hash for the transaction on its
|
|
first access so subsequent accesses don't have to repeat the relatively
|
|
expensive hashing operations.
|
|
|
|
Address Overview
|
|
|
|
The Address interface provides an abstraction for a kaspa address. While the
|
|
most common type is a pay-to-pubkey-hash, kaspa already supports others and
|
|
may well support more in the future. This package currently provides
|
|
implementations for the pay-to-pubkey-hash, and pay-to-script-hash address
|
|
types.
|
|
|
|
To decode/encode an address:
|
|
|
|
addrString := "kaspa:qqfgqp8l9l90zwetj84k2jcac2m8falvvyy8xjtnhd"
|
|
defaultPrefix := util.Bech32PrefixKaspa
|
|
addr, err := util.DecodeAddress(addrString, defaultPrefix)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
fmt.Println(addr.EncodeAddress())
|
|
*/
|
|
package util
|