Documentation
¶
Index ¶
- func AppendMultisigTransaction(sk ed25519.PrivateKey, pk MultisigAccount, preStxBytes []byte) (txid string, stxBytes []byte, err error)
- func MergeMultisigTransactions(stxsBytes ...[]byte) (txid string, stxBytes []byte, err error)
- func RandomBytes(s []byte)
- func SignBid(sk ed25519.PrivateKey, bid types.Bid) (signedBid []byte, err error)
- func SignMultisigTransaction(sk ed25519.PrivateKey, pk MultisigAccount, tx types.Transaction) (txid string, stxBytes []byte, err error)
- func SignTransaction(sk ed25519.PrivateKey, tx types.Transaction) (txid string, stxBytes []byte, err error)
- type Account
- type MultisigAccount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendMultisigTransaction ¶
func AppendMultisigTransaction(sk ed25519.PrivateKey, pk MultisigAccount, preStxBytes []byte) (txid string, stxBytes []byte, err error)
AppendMultisigTransaction appends the signature corresponding to the given private key, returning an encoded signed multisig transaction including the signature. While we could compute the multisig preimage from the multisig blob, we ask the caller to pass it back in, to explicitly check that they know who they are signing as.
func MergeMultisigTransactions ¶
MergeMultisigTransactions merges the given (partially) signed multisig transactions, and returns an encoded signed multisig transaction with the component signatures.
func RandomBytes ¶
func RandomBytes(s []byte)
RandomBytes fills the passed slice with randomness, and panics if it is unable to do so
func SignBid ¶
SignBid accepts a private key and a bid, and returns the signature of the bid under that key
func SignMultisigTransaction ¶
func SignMultisigTransaction(sk ed25519.PrivateKey, pk MultisigAccount, tx types.Transaction) (txid string, stxBytes []byte, err error)
SignMultisigTransaction signs the given transaction, and multisig preimage, with the private key, returning the bytes of a signed transaction with the multisig field partially populated, ready to be passed to other multisig signers to sign or broadcast.
func SignTransaction ¶
func SignTransaction(sk ed25519.PrivateKey, tx types.Transaction) (txid string, stxBytes []byte, err error)
SignTransaction accepts a private key and a transaction, and returns the bytes of a signed transaction ready to be broadcasted to the network
Types ¶
type Account ¶
type Account struct { PublicKey ed25519.PublicKey PrivateKey ed25519.PrivateKey Address types.Address }
Account holds both the public and private information associated with an Algorand address
func GenerateAccount ¶
func GenerateAccount() (kp Account)
GenerateAccount generates a random Account
type MultisigAccount ¶
type MultisigAccount struct { // Version is the version of this multisig Version uint8 // Threshold is how many signatures are needed to fully sign as this address Threshold uint8 // Pks is an ordered list of public keys that could potentially sign a message Pks []ed25519.PublicKey }
MultisigAccount is a convenience type for holding multisig preimage data
func MultisigAccountFromSig ¶
func MultisigAccountFromSig(sig types.MultisigSig) (ma MultisigAccount, err error)
MultisigAccountFromSig is a convenience method that creates an account from a sig in a signed tx. Useful for getting addresses from signed msig txs, etc.
func MultisigAccountWithParams ¶
func MultisigAccountWithParams(version uint8, threshold uint8, addrs []types.Address) (ma MultisigAccount, err error)
MultisigAccountWithParams creates a MultisigAccount with the given parameters
func (MultisigAccount) Address ¶
func (ma MultisigAccount) Address() (addr types.Address, err error)
Address takes this multisig preimage data, and generates the corresponding identifying address, committing to the exact group, version, and public keys that it requires to sign. Hash("MultisigAddr" || version uint8 || threshold uint8 || PK1 || PK2 || ...)
func (MultisigAccount) Validate ¶
func (ma MultisigAccount) Validate() (err error)
Validate ensures that this multisig setup is a valid multisig account